虚拟环境不从Python 3.6.4中的虚拟环境站点包导入包

时间:2018-02-27 20:50:42

标签: python python-3.x virtualenv

我为python 3.6.4创建了一个虚拟环境(venv64)。并安装了ujson。它安装在虚拟环境站点包中。

但是,当我尝试在虚拟环境中导入ujson时。它给了我一个错误:

  

ModuleNotFoundError:没有名为'ujson'的模块

当我检查时

sys.path

我得到了:

['', 'C:\\Python36\\python36.zip', 'C:\\Python36\\DLLs','C:\\Python36\\lib','C:\\Python36', 'C:\\Users\\Khushal Adlakha\\AppData\\Roaming\\Python\\Python36\\site-packages','C:\\Python36\\lib\\site-packages']

相反它应该是:

C:\Python36\venv64\Lib\site-packages

为什么虚拟环境没有使用它自己的网站包?

在venv节目中pip冻结:

certifi==2018.1.18
chardet==3.0.4 
cymem==1.31.2
cytoolz==0.8.2
dill==0.2.7.1
falcon==1.4.1
ftfy==4.4.3
html5lib==1.0b8
hug==2.4.0
hug-middleware-cors==1.0.0
idna==2.6
mmh3==2.5.1
msgpack-numpy==0.4.1
msgpack-python==0.5.4
murmurhash==0.28.0
numpy==1.14.1
pathlib==1.0.1
peewee==2.10.2
plac==0.9.6
preshed==1.0.0
prodigy==1.3.0
pyreadline==2.1
python-mimeparse==1.6.0
regex==2017.4.5
requests==2.18.4
six==1.11.0
spacy==2.0.9
termcolor==1.1.0
thinc==6.10.2
toolz==0.9.0
tqdm==4.19.6
ujson==1.35
urllib3==1.22
waitress==1.1.0
wcwidth==0.1.7
wrapt==1.10.11
  • Windows 10 64位
  • Python 3.6.4(64位)

0 个答案:

没有答案
相关问题