pip listing global packages in active virtualenv

只谈情不闲聊 提交于 2021-02-19 01:15:34

问题


After upgrading pip from 1.4.x to 1.5 pip freeze outputs a list of my globally installed (system) packages instead of the ones installed inside of my virtualenv. I've tried downgrading to 1.4 again but that does not solve my problem. It's somewhat similar to this question only it's been working as expected for months. Is there any way to debug and/or repair this?

It seems like the virtualenv has no effect at all. Installing packages within it installs them globally too.


回答1:


I had problems with pip installing packages globally instead of in the activated virtualenv too. Have a look at pip installing in global site-packages instead of virtualenv for the question (and the answer).

Basically, the solution consisted of modifying the shebang of the pip scripts within the virtualenv as they pointed to the wrong python installation.




回答2:


Even if you have installed properly, but with global site packages visible to your virtualenv, still pip will list everything, unless you use pip list --local discussed here.



来源:https://stackoverflow.com/questions/21017012/pip-listing-global-packages-in-active-virtualenv

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!