python 下neo4j知识图谱构建中的几个小问题

一些问题总结:

1. ValueError: The following settings are not supported”报错

py2neo默认安装版本为最新版本
出现报错

ValueError: The following settings are not supported: {'username': 'neo4j'}
pip list
.....
...
py2neo                  2021.2.3

安装低版本的py2neo可以解决问题

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple py2neo==4.1.0

2.ImportError: cannot import name ‘clock‘ from ‘time‘ (unknown location)

python3.8已经放弃time的clock。
解决方案:找到对应源文件,该里面的内容将time中的clock用process_time来替代
from time import clock as timer 改为
from time import process_time as timer

# from time import clock   ##出现无法cannot import name 'clock' from 'time'
from time import process_time as timer
 # timer = clock

3. module ‘time’ has no attribute ‘clock’

AttributeError: module 'time' has no attribute 'clock'

原因:Python3.8不再支持time.clock,但在调用时依然包含该方法
解决办法:
更换time.clock()方法为time.perf.counter()

      # start = time.clock()
       start = time.perf_counter()

你可能感兴趣的:(知识图谱和本体构建学习,python,知识图谱,开发语言,django)