我使用虚拟包装器来创建/管理我的虚拟环境。在我的环境中运行pip冻结程序时,我惊讶地发现,在我的新环境中安装了几十个Python模块和包(在我还没有了解虚拟化/包装器之前就已经安装了)。
这不是预期的行为;我希望有一个干净的环境,只有我在该环境中安装的包是可用的。
我使用的命令是:
mkvirtualenv --no-site-packages mynewenv
当我在那个新环境中运行pip freeze时,我得到了以下长列表(我期望在新环境中不会安装任何东西):
apturl (0.5.2)
beautifulsoup4 (4.4.1)
bleach (1.5.0)
blinker (1.3)
Brlapi (0.6.4)
chardet (2.3.0)
checkbox-support (0.22)
command-not-found (0.3)
coverage (3.7.1)
cryptography (1.2.3)
Cython (0.25.2)
decorator (4.0.10)
defer (1.0.6)
Django (1.10.5)
djangorestframework (3.5.3)
entrypoints (0.2.2)
enum34 (1.1.6)
feedparser (5.1.3)
guacamole (0.9.2)
html5lib (0.999)
httplib2 (0.9.1)
idna (2.0)
ipykernel (4.5.2)
ipython (5.1.0)
ipython-genutils (0.1.0)
ipywidgets (5.2.2)
Jinja2 (2.8)
jsonschema (2.5.1)
jupyter (1.0.0)
jupyter-client (4.4.0)
jupyter-console (5.0.0)
jupyter-core (4.2.1)
language-selector (0.1)
louis (2.6.4)
lxml (3.5.0)
lz4 (0.8.2)
Mako (1.0.3)
MarkupSafe (0.23)
mistune (0.7.3)
mockextras (1.0.2)
nbconvert (5.0.0)
nbformat (4.2.0)
notebook (4.3.1)
numpy (1.11.3)
oauthlib (1.0.3)
onboard (1.2.0)
padme (1.1.1)
pandas (0.19.2)
pandocfilters (1.4.1)
pbr (1.10.0)
pexpect (4.0.1)
pickleshare (0.7.4)
Pillow (3.1.2)
pip (9.0.1)
plainbox (0.25)
prompt-toolkit (1.0.9)
ptyprocess (0.5)
pyasn1 (0.1.9)
pycups (1.9.73)
pycurl (7.43.0)
Pygments (2.1)
pygobject (3.20.0)
PyJWT (1.3.0)
pymongo (3.4.0)
pyparsing (2.0.3)
pysmbc (1.0.15.5)
python-apt (1.1.0b1)
python-dateutil (2.6.0)
python-debian (0.1.27)
python-systemd (231)
pytz (2016.10)
pyxdg (0.25)
pyzmq (16.0.2)
qtconsole (4.2.1)
reportlab (3.3.0)
requests (2.9.1)
sessioninstaller (0.0.0)
setuptools (23.0.0)
simplegeneric (0.8.1)
six (1.10.0)
stevedore (1.15.0)
system-service (0.3)
terminado (0.6)
testpath (0.3)
tornado (4.4.2)
traitlets (4.3.1)
tzlocal (1.3)
ubuntu-drivers-common (0.0.0)
ufw (0.35)
unattended-upgrades (0.1)
unity-scope-calculator (0.1)
unity-scope-chromiumbookmarks (0.1)
unity-scope-colourlovers (0.1)
unity-scope-devhelp (0.1)
unity-scope-firefoxbookmarks (0.1)
unity-scope-gdrive (0.7)
unity-scope-manpages (0.1)
unity-scope-openclipart (0.1)
unity-scope-texdoc (0.1)
unity-scope-tomboy (0.1)
unity-scope-virtualbox (0.1)
unity-scope-yelp (0.1)
unity-scope-zotero (0.1)
urllib3 (1.13.1)
usb-creator (0.3.0)
virtualenv (15.1.0)
virtualenv-clone (0.2.6)
wcwidth (0.1.7)
wheel (0.29.0)
widgetsnbextension (1.2.6)
xdiagnose (3.8.4)
xkit (0.0.0)
XlsxWriter (0.7.3)[杂项信息]
virtualenv --version 15.1.0
virtualenvwrapper==4.7.2
OS: Ubuntu 16.0.4
Python: 2.7 & 3.5
which pip : /usr/local/bin/pip
which pip3: /usr/local/bin/pip3我做错了什么?
发布于 2017-01-09 15:12:23
你激活虚拟主机了吗?这是通过“寻找”活动脚本来完成的:
source <env>/bin/activate其他问题可能是长路径名称或路径中的空格。pwd在您的虚拟目录中提供了什么?
https://stackoverflow.com/questions/41549175
复制相似问题