Pip requirements outputting global packages

我怕爱的太早我们不能终老 提交于 2019-12-05 16:28:31

If your virtual environment has access to the system's site-packages dir (ie. you used virtualenv --system-site-packages) then it's normal for the list to be a rather long one.

Compare the following:

$ virtualenv --system-site-packages v1 && source v1/bin/activate
$ (v1) pip freeze | wc -l  # 100

$ virtualenv v2 && source v2/bin/activate
$ (v2) pip freeze | wc -l  # 2

Can you try recreating the virtualenv?

Alternatively, adding a no-global-site-packages.txt file should tell pip to ignore the global site-packages:

$ touch $VIRTUAL_ENV/lib/python${version}/no-global-site-packages.txt
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!