我在我的机器上安装了多个pythons,2.7,3.5,3.6等,我安装了名为spacy的库.
看起来这个库一直在引用旧版本的python 3.5.在/usr/local/lib/python3.5/dist-packages.
Python 3.6.5 (default, Mar 29 2018, 03:28:50)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import spacy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.5/dist-packages/spacy/__init__.py", line 4, in <module>
from . import util
File "/usr/local/lib/python3.5/dist-packages/spacy/util.py", line 4, in <module>
import ujson
ModuleNotFoundError: No module named 'ujson'
不管这个特定的图书馆’spacy’,我想知道
什么是使库指向升级的python的最佳方法,即3.6,而不是3.5.我应该更新哪个路径变量?
请帮忙……我在这个问题上浪费了太多时间.
解决方法:
尝试通过在模块模式下运行带有所需python版本的pip来安装spacy lib:
python3.6 -m pip install spacy