question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

My pip is broken. _internal module cannot be imported.

See original GitHub issue

Maintainer note: Anyone that still gets this issue please see #5599.


  • Pip version: 8.1.1
  • Python version: 2.7.12
  • Operating system: Ubuntu 16.04 (64 bit)

Description:

my pip is broken. it cannot update. It also complains error when just type pip.

What I’ve run:

pip

Traceback (most recent call last):
  File "/usr/local/bin/pip", line7, in <module>
      from pip._internal import main
ImportError: No module named _internal

Also tried sudo pip or sudo su; pip, with same output.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:7
  • Comments:23 (2 by maintainers)

github_iconTop GitHub Comments

94reactions
Shuailongcommented, May 16, 2018

I just change the from pip._internal import main into from pip import main and Voila! Problem dismissed

93reactions
zchrissirhczcommented, Apr 16, 2018

By typing:

sudo apt remove python-pip

the problem disappears. Strange.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - Unable to import a module that is definitely installed
In my case, it is permission problem. The package was somehow installed with root rw permission only, other user just cannot rw to...
Read more >
Pip is not working: ImportError: No module named 'pip._internal'
Go to /usr/local/bin by terminal; Execute sudo gedit pip; Change the from pip._internal import main into from pip import main .
Read more >
PyCharm can't install/import a package/library/module
Try installing/importing a package from the system terminal (outside of PyCharm) using the same interpreter/environment.
Read more >
Resolve "Unable to import module" errors from Python ... - AWS
I receive an "Unable to import module" error when I try to run my AWS Lambda code in Python. How do I resolve...
Read more >
2021 How to Fix "No Module Named..." Error in Python
2021 How to Fix ImportError "No Module Named pkg_name" in Python ! First, download the package using a ... Then fix your %PATH%...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found