-
Notifications
You must be signed in to change notification settings - Fork 3.1k
pip.conf user = true conflicts with venv #8977
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
Comments
FYI there's a |
pip has real config in a virtual environment, at |
#4141 has relevent discussions. (Probably not the one you’re thinking about, there are several threads on this.) |
Apparently not (anymore if it ever did).
That works though to be more precise it has to be:
and this rather esoteric feature could be more accessibly documented. But the fault there lies with venv not pip I suspect. Creating a new venv should really just create this file given they are in conflict otherwise. |
I suppose you meant virtual config 😄 (or config exclusively for the virtual environment, because my metaphor game suck 😞). Also thanks for the pointer, it's not what I was looking for but interesting discussion indeed.
I'm pretty sure that it exists and I have suggested this in another thread not so long ago. Try |
This is not a supported end-user flag. Please don't use this. |
Ah, thanks for the information. I was about to ask why but found GH-5116. I'll stop suggesting it to others but you can't stop me from using it myself 😈 Edit: jokes aside, could you share which situation led you to have |
it came recommended, more than once, in different contexts now. I do active Python development on an Ubuntu derived system (Mint) and the Desktop Environment and other system utilities are increasingly Python dependent. I have broken elements of my desktop before by keeping system Python libs up to date. I've been warned NEVER To do The short answer is: I've been told in no uncertain terms NEVER to do |
It shouldn't (assuming a recent pip). If site-packages isn't writeable, pip falls back to user site automatically. The recommendations you have seen are basically out of date and flawed, as you found out. (Never using sudo with pip is 100% correct advice, though 🙂) Unfortunately, it's hard to get rid of out of date information on the internet 🙁 |
Thanks for clarifying! pip evolves! And yes on-line advice can't always keep up with the sometimes impressive rate of improvement of FOSS! Alas. But it's a simple consequence of the FOSS boom methinks and how awesomely it marches forward. |
Environment
Description
If
pip.conf
contains theuser = true
instruction then attempting to run pip in a venv results in:I could find not command line option that is the oppposite of
user
(i.e. disables thepip.conf
setuser = true
and so had to editpip.conf
in order to install packages into a venv with pip.Expected behavior
I'd expect not to have to edit
pip.conf
. If pip is run from within a venv and is aware it's in a venv how about silently ignoring the--user
option? Or providing a command line option like--nouser
to request it be ignored. That way Makefiles that implement venvs don't bomb on a local dev system which by default hasuser = true
(which after all is recommended ... as we're working desktop environments that have loads of Python code and fiddling with system libs is not recommended, we leave that to Ubuntu or our distro to do, and useuser = true
to do our Python dev work)How to Reproduce
Add
user = true
topip.conf
(in~/.config/pip/pip.conf
on Ubuntu systems) and then create and activate a venv and try to install package with pip.Output
The text was updated successfully, but these errors were encountered: