8

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

2 Answers 2

8

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.

0
3

One quick fix is (this work for me!):

  1. Go to the pyvenv.cfg file in the Virtual environment folder

  2. Set the include-system-site-packages to true and save the change

  3. Reactivate the virtual environment. This should work!

Thank's to jeffmaddocks!

Not the answer you're looking for? Browse other questions tagged or ask your own question.