Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtualenv not working with some distros' pip.conf (fix proposal) #1416

Closed
zabealbe opened this issue Sep 8, 2019 · 4 comments
Closed

Virtualenv not working with some distros' pip.conf (fix proposal) #1416

zabealbe opened this issue Sep 8, 2019 · 4 comments

Comments

@zabealbe
Copy link

zabealbe commented Sep 8, 2019

Hello!

Today i had this error
ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv.
which really confused me as there was no --user in my command
(venv) user$ pip install numpy

So I searched a bit on google but unfortunately i didn't find anything helpful.
I decided to take a look into pip source code and found that there is a config (never touched it before so It's the first time I hear about it), in my case in /etc/pip.conf (Linux Manjaro)

[global]
user = true

Although I agree that installing modules in the user's directory is safer, I think that this configuration might be a problem for a lot of users specially because if you get that error you won't find any solution searching for it.
So my proposal is to include a pip.conf inside the venv by default:

[global]
user = false

@pfmoore
Copy link
Member

pfmoore commented Sep 8, 2019

I would argue that this is a misconfiguration on the part of the distribution. Well-intentioned, perhaps, but not properly thought through. So it's probably something that should be raised with the distro in the first instance.

Note also that pip is looking at improving this - see pypa/pip#4575 which links a number of other issues but is a good place to start from.

I'm not at all sure that virtualenv is the right place to fix this (for a start, it wouldn't help users of the stdlib venv module, who presumably have the same issue).

@zabealbe
Copy link
Author

zabealbe commented Sep 8, 2019

I would argue that this is a misconfiguration on the part of the distribution. Well-intentioned, perhaps, but not properly thought through. So it's probably something that should be raised with the distro in the first instance.

Note also that pip is looking at improving this - see pypa/pip#4575 which links a number of other issues but is a good place to start from.

I'm not at all sure that virtualenv is the right place to fix this (for a start, it wouldn't help users of the stdlib venv module, who presumably have the same issue).

Indeed they do have the same issue, but the behavior is much different, it actually installs the modules in user directory but then python can't find them, it's a mess.
My main goal was to help the next person searching for this on Google as I lost way too much time on that

@jollescott
Copy link

Hello!

Today i had this error
ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv.
which really confused me as there was no --user in my command
(venv) user$ pip install numpy

So I searched a bit on google but unfortunately i didn't find anything helpful.
I decided to take a look into pip source code and found that there is a config (never touched it before so It's the first time I hear about it), in my case in /etc/pip.conf (Linux Manjaro)

[global]
user = true

Although I agree that installing modules in the user's directory is safer, I think that this configuration might be a problem for a lot of users specially because if you get that error you won't find any solution searching for it.
So my proposal is to include a pip.conf inside the venv by default:

[global]
user = false

Started running into this last week out of nowhere on Manjaro. Thanks for the solution.

@gaborbernat
Copy link
Contributor

This feels like a pip issue, so I'll close.

@pypa pypa locked and limited conversation to collaborators Jan 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants