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

pip.locations not found #5246

tdegeus opened this issue Apr 16, 2018 · 4 comments


Copy link

@tdegeus tdegeus commented Apr 16, 2018

  • Pip version: 10.0.0
  • Python version: 3.6.5
  • Operating system: MacOS (+ Homebrew)


After upgrading to pip 10.0.0 I cannot use pip.locations anymore.

What I've run:

from pip import locations
ImportError                               Traceback (most recent call last)
<ipython-input-1-d1893601ee79> in <module>()
----> 1 from pip import locations

ImportError: cannot import name 'locations'

What 'fixes' the problem

Downgrading using

pip3 install pip==9.0.3

solves this issue.


This comment has been minimized.

Copy link

@RonnyPfannschmidt RonnyPfannschmidt commented Apr 16, 2018

thats expected behaviour, the api was never public and pip10 now did away wit that after ages of warning people about it


This comment has been minimized.

Copy link

@pradyunsg pradyunsg commented Apr 16, 2018

Hi @tdegeus!

You are trying to use an internal, implementation detail of pip which is not a supported way of using pip. After a long history of asking users to move away from doing so, pip 10 made this explicit by moving almost all of the code into pip._internal namespace.

You can find more details on this in the User Guide.

Note that just changing your import to point to the new location, is not how you should "fix" this. That is unsupported so you'll be on your own if something breaks.

I believe you can find supported alternative ways for the getting the locations that you're trying to get from pip's internals.


This comment has been minimized.

Copy link

@tdegeus tdegeus commented Apr 16, 2018

Thanks a lot @RonnyPfannschmidt and @pradyunsg. This is an example of copying without profoundly investigating. I have modified my code such that it does not use pip.internal anymore.


This comment has been minimized.

Copy link

@lock lock bot commented Jun 2, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the S: auto-locked label Jun 2, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
3 participants
You can’t perform that action at this time.