簡體   English   中英

Python 連接到 OrientDB

[英]Python connection to OrientDB

我正在嘗試使用 pyorient 連接到 orientdb,但收到以下錯誤...

[...]
  File "C:\Users\civan\Documents\GitHub\code\venv\lib\site-packages\pyorient\orient.py", line 101, in connect
    raise PyOrientWrongProtocolVersionException(
pyorient.exceptions.PyOrientWrongProtocolVersionException: Protocol version 37 is not supported yet by this client.

我使用這樣的示例代碼:

import pyorient

client = pyorient.OrientDB("etc", 2424)
session_id = client.db_open("db", "admin", "pass!")
sql = "SELECT id, name, ifnull(org_id, 1) AS org_id, create_dt.format('yyyy-MM-dd HH:mm:ss') AS create_dt FROM Client"
records = client.query(sql)
data = [o.oRecordData for o in records]
print(f'Fetched {len(data)} rows')

我嘗試了以下解決方案:

https://github.com/orientechnologies/pyorient/issues/27#issuecomment-647029817

但它沒有奏效

無論如何只有舊信息,也許您知道一些新信息?

謝謝

實際上,此代碼https://github.com/OpenConjecture/pyorient是唯一的答案,並且有效。 您可以自己從 orient.py 中刪除這些行,也可以使用 git 中的更新,我遇到了雙重問題。 一個有密碼,一個有這個連接,沒有意識到真正的來源。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM