-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Check write permissions before downloading any files #1048
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
I agree with the implementation as Nick puts it here. It doesn't change the default (which would be a change in behavior), but it directs users to a possibility of virtual environments or the user packages. |
at one point, this got the PEP439 label. Are we considering this critical for PEP453, or just nice to have. It sure is time, we did something about this. |
Nice to have, not critical. |
Would definitely be nice, but not a blocker. The only blocker identified so |
that's pretty complicated it seems for pip, given pip just subprocesses to setuptools
3 thoughts:
|
another thought is for pip to only try do this pre-check for the normal case (i.e. without special options), which would handle 99% of these permission exceptions. |
but I guess pydistutils.cfg files could be lurking with special options, and we'd be checking the wrong thing. |
It's worth asking Jason about setuptools doing the early check, after it has figured out all the relevant details. Alternatively, just extracting the logic to check for the existence of pydistutils.cfg files (which I didn't know were a possibility until reading the previous comment) and whether or not any relevant parameters are set would still solve the usability problem for beginners. |
Oh, the other option is for setuptools to expose the "find install path" logic as a usable API (but that may not be feasible due to the arcana that is the distutils command system). |
I think this should be bumped from the 1.5 timeline. It's not a blocker and I believe it's got significant enough work to be done in it that it's unlikely to happen. Any objections? |
I agree. to do it right, it's a bit of work unfortunately. |
Ok, then i'm gonna drop this off of 1.5 then. |
Looks like this has been open for some time now with know progress, any updates? |
Closing this, as once we implement #1668 we should not typically run into permission errors where it makes sense to spend time implementing this. |
The error message when the user doesn't have write permissions to the installation directory isn't very clear, and doesn't happen until after pip has done a fair bit of work.
It should do an early check for write permissions, and if they aren't available, produce an error message along the lines of the following (for a system install):
"Cannot install to this location: no write permissions for '<site-packages>'. Consider using '--user' or a virtual environment."
For a user install or a virtual environment install, the message would just be the first sentence (since we have no helpful suggestions to offer in that case):
"Cannot install to this location: no write permissions for '<site-packages>'.
The text was updated successfully, but these errors were encountered: