Neo4j 介绍(三):使用 python 访问 neo4j

栏目: Python · 发布时间: 7年前

内容简介:这里主要介绍使用 python 访问 neo4j 的方法。python driver 的地址:需要安装 python 3 版本,然后安装 pip3, 通过 pip3 安装驱动可以把驱动安装到 python 3 对应的库。

这里主要介绍使用 python 访问 neo4j 的方法。

python driver 的地址: https://github.com/neo4j/neo4j-python-driver

需要安装 python 3 版本,然后安装 pip3, 通过 pip3 安装驱动可以把驱动安装到 python 3 对应的库。

安装驱动:

pip install git+https://github.com/neo4j/neo4j-python-driver.git#egg=neo4j

有可能会在运行时报错,

File “/usr/local/lib/python3.4/dist-packages/neobolt/direct.py”, line 123, in supports  return self.version_info() >= (3, 2) TypeError: unorderable types: str() >= int()

定位到报错的文件,发现报错的是 direct.py 文件的 supports() 函数。报错的原因的类型不匹配,通过调试发现, self.version_info() 返回的是字符串数组 ('dev',) , 运行 self.version_info() >= (3, 2) 显然就会报错。没有找到有效的解决办法。 supports() 函数主要是进行版本检查的,不是核心业务代码,所以目前的解决办法是,直接在 supports() 函数的第一行添加 return True , 默认版本检查通过。然后运行,发现没有报错。


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Data Structures and Algorithms

Data Structures and Algorithms

Alfred V. Aho、Jeffrey D. Ullman、John E. Hopcroft / Addison Wesley / 1983-1-11 / USD 74.20

The authors' treatment of data structures in Data Structures and Algorithms is unified by an informal notion of "abstract data types," allowing readers to compare different implementations of the same......一起来看看 《Data Structures and Algorithms》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具