我的虚拟环境可以访问全局软件包 [英] My virtual environment is having access to global packages
问题描述
我已经安装了 virtualenv 15.1.0
.问题是,当我使用
I have virtualenv 15.1.0
installed. The problem is that when I create a virtual environment with
virtualenv venv
然后激活它,它将可以访问全局安装的软件包(例如, django-admin
).尽管发生在 virtualenv
参考指南
and then activate it, it will have access to packages installed globally (django-admin
for example). This happens although it is mentioned in virtualenv
reference guide here that:
现在无法访问全局站点程序包.
Not having access to global site-packages is now the default behavior.
此外,我想提一提的是,在激活虚拟环境时运行 pip3冻结
不会打印任何内容.
Also, I want to mention that running pip3 freeze
while the virtual environment is activated prints nothing.
推荐答案
检查环境变量?例如 $ PATH
, $ PYTHONPATH
.
Check your environment variables? Such as $PATH
, $PYTHONPATH
.
virtualenv只是操纵您的环境变量.
virtualenv just manipulate your environment variables.
这篇关于我的虚拟环境可以访问全局软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!