python里orient_从Python访问OrientDB
我想將一個> 1mn記錄的
MySQL數據庫轉換成一個圖形數據庫,因為它是一個鏈接很多的網絡類型數據. Neo4J的免費版本有一些我認為可能會遇到的限制,因此我安裝了OrientDB(Community 2.2.0)(在Ubuntu Server 16.04上)并使其正常運行.現在我需要從
Python(3.5.1)訪問它,所以我正在嘗試pyorient(1.5.2). (我嘗試使用TinkerPop,因為我最終想要使用Gremlin,并且無法讓gremlin控制臺與OrientDB交談.)
以下簡單的Python代碼,用于連接到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")
給出了一個奇怪的錯誤:
SessionID= 27
Database GratefulDeadConcerts exists
Traceback (most recent call last):
File "FirstTest.py", line 18, in
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'
有誰知道這是什么或如何解決它?我應該真的使用TinkerPop嗎?如果是這樣的話,我會發布一個關于我與之斗爭的單獨問題.
總結
以上是生活随笔為你收集整理的python里orient_从Python访问OrientDB的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: mfc 监控文件操作_mfc是什么
- 下一篇: python 单元测试 工具_Djang