问题
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