Pip won't install packages in virtualenv

爷,独闯天下 提交于 2019-12-21 19:43:01

问题


After performing a system upgrade this morning, I'm not able to install or update packages in any of my old or fresh created virtual environments. I create the virtual environments using virtualenvwrapper.

I've tried rebooting my PC, recreating all of my virtual environments, but nothing worked. Strange enough, pip freeze does not output my installed packages, although they are found in sitepackages.

Im using python3.7 on manjaro linux with the newest kernel. In my envs and on my system pip 19.2.3 is installed.

The error I'm seeing is the following:

pip install <package>
ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv.

When trying to use the system pip without virtualenv, everything works just fine.

pip install cython
Requirement already satisfied: cython in /home/manuel/.local/lib/python3.7/site-packages (0.29.13

I expect pip to install the desired package to the sitepackages folder of my virtualenv without telling me to not use a '--user' install, which I'm not doing explicitly anyway


回答1:


I was able to fix this myself. I checked all the pip config files here https://pip.pypa.io/en/latest/user_guide/#configuration

Seems like in the pip configuration file /etc/pip.conf the user parameter was set to true. Changing it to false resolved my issue.

I still don't know why/if the config file changed.



来源:https://stackoverflow.com/questions/57801495/pip-wont-install-packages-in-virtualenv

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