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

Global pip installs can be broken for users other than the installer. #3856

Closed
thanatos opened this issue Jul 20, 2016 · 2 comments
Closed
Labels
C: user scheme Handling of packages in user-specific directories type: bug A confirmed bug or unintended behavior type: enhancement Improvements to functionality

Comments

@thanatos
Copy link
Contributor

thanatos commented Jul 20, 2016

  • Pip version: 8.1.2
  • Python version: 3.5.2
  • Operating System: OS X

Description:

pip will install a package that is broken for other users.

Say I have two user accounts on my machine, alice and bob; if alice does the following,

$ pip3 install --user six
$ # then, later,
$ pip3 install ipython

The second command installs ipython globally; however, it does not install six, a dependency of ipython, because it believes that dependency to be fulfilled by the user-only install of it. As a result, ipython will work for alice, but not bob.

This is perhaps somewhat subjective, but I expect global pip installs to be global, and not depend on the state of the user who is running pip. If pip here excluded --user installs when determining if a dependency was met, the package would install correctly.

(I find it acceptable for --user packages to shadow global ones; this could result in the situation whereby a user has an incompatible version installed in --user that the global install can not use, but this situation is already possible today, and seems hard to eliminate without some sort of concept of what emerge calls slots.)

What I've run:

$ pip3 install --user six
$ # then, later,
$ pip3 install ipython
@pradyunsg
Copy link
Member

Hey @thanatos! Thanks for filing this issue and sorry for the lack of a response all this while.

This is indeed an interesting problem and I'm not sure how exactly this can be addressed. I'm gonna link this to #4575 since this could be something that would benefit from that change.

@pradyunsg pradyunsg added type: bug A confirmed bug or unintended behavior type: enhancement Improvements to functionality C: user scheme Handling of packages in user-specific directories labels Mar 5, 2018
@pradyunsg
Copy link
Member

This is expected to happen, due to how redistributors modify pip/Python. We've since worked on a solution (described in https://peps.python.org/pep-0668/) for this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C: user scheme Handling of packages in user-specific directories type: bug A confirmed bug or unintended behavior type: enhancement Improvements to functionality
Projects
None yet
Development

No branches or pull requests

2 participants