5

I want to convert a >1mn record MySQL database into a graph database, because it is heavily linked network-type data. The free version of Neo4J had some restrictions I thought I might bump up against, so I've installed OrientDB (Community 2.2.0) (on Ubuntu Server 16.04) and got it working. Now I need to access it from Python (3.5.1+), so I'm trying pyorient (1.5.2). (I tried TinkerPop since I eventually want to use Gremlin, and couldn't get the gremlin console to talk to the OrientDB.)

The following simple Python code, to connect to one of the test graphs in OrientDB:

import pyorient

username="user"
password="password"

client = pyorient.OrientDB("localhost", 2424)
session_id = client.connect( username, password )

print("SessionID=",session_id)

db_name="GratefulDeadConcerts"

if client.db_exists( db_name, pyorient.STORAGE_TYPE_MEMORY ):
    print("Database",db_name,"exists")
    client.db_open( db_name, username, password )
else:
    print("Database",db_name,"doesn't exist")

gives a weird error:

SessionID= 27
Database GratefulDeadConcerts exists
Traceback (most recent call last):
  File "FirstTest.py", line 18, in <module>
    client.db_open( db_name, username, password )
  File "/home/tom/MyProgs/TestingPyOrient/env/lib/python3.5/site-packages/pyorient/orient.py", line 379, in db_open
    .prepare((db_name, user, password, db_type, client_id)).send().fetch_response()
  File "/home/tom/MyProgs/TestingPyOrient/env/lib/python3.5/site-packages/pyorient/messages/database.py", line 141, in fetch_response
    info = OrientVersion(release)
  File "/home/tom/MyProgs/TestingPyOrient/env/lib/python3.5/site-packages/pyorient/otypes.py", line 202, in __init__
    self._parse_version(release)
  File "/home/tom/MyProgs/TestingPyOrient/env/lib/python3.5/site-packages/pyorient/otypes.py", line 235, in _parse_version
    self.build = int( self.build )
ValueError: invalid literal for int() with base 10: '0 (build develop@r79d281140b01c0bc3b566a46a64f1573cb359783; 2016'

Does anyone know what that is or how I can fix it? Should I really be using TinkerPop instead? If so I'll post a seperate question about my struggles with that.

TomG
  • 145
  • 8
  • Hi @TomG, I tried your case and I got your same error with ODB Community 2.2.0 but not with 2.1.x version. Could you open an issue on [Github](https://github.com/orientechnologies/orientdb/issues) ? – LucaS Jun 08 '16 at 19:44
  • also facing this... hopefully further investigated under [issue 200](https://github.com/mogui/pyorient/issues/200) – Jürgen Zornig Jun 23 '16 at 08:46

1 Answers1

2

I firstly got the error, but after upgrading Pyorient to last version 1.5.4 I get no errors.

$ python test.py 
('SessionID=', 6)
('Database', 'GratefulDeadConcerts', 'exists')

$ python --version
Python 2.7.11
Ivan Mainetti
  • 1,982
  • 7
  • 13
  • Yay, just didn't have the idea that there could be a newer Version on pip...ist working with 1.5.4, thanks a lot! (Will award bounty when it's unlocked) – Jürgen Zornig Jun 23 '16 at 13:13