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.

pip ImportError: cannot import name 'main' after update

See original GitHub issue

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


Environment

  • pip version: ???
  • Python version: 3.5.2
  • OS: Linux sas-linuxmint 4.4.0-92-generic #115-Ubuntu SMP Thu Aug 10 09:04:33 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
sas@sas-linuxmint /usr/bin $ pip3 install --user --upgrade pip
Collecting pip
  Using cached https://files.pythonhosted.org/packages/0f/74/ecd13431bcc456ed390b44c8a6e917c1820365cbebcb6a8974d1cd045ab4/pip-10.0.1-py2.py3-none-any.whl
Installing collected packages: pip
Successfully installed pip-8.1.1
You are using pip version 8.1.1, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
ImportError: cannot import name 'main'
sas@sas-linuxmint /usr/bin $ pip3 install --upgrade pip
Traceback (most recent call last):
  File "/usr/bin/pip3", line 9, in <module>
    from pip import main
ImportError: cannot import name 'main'

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:18 (5 by maintainers)

github_iconTop GitHub Comments

76reactions
gwuahcommented, Jul 25, 2018

hash -d pip worked for me

56reactions
vitordouzicommented, Jul 30, 2018

I had the same problem, but uninstall and reinstall with apt and pip didn’t work for me.

I saw another solution on stackoverflow that presents a easy way to recover pip3 path:

sudo python3 -m pip uninstall pip && sudo apt install python3-pip --reinstall

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error after upgrading pip: cannot import name 'main'
You can resolve this issue by reinstalling pip. Use one of the following command line commands to reinstall pip:.
Read more >
[SOLVED] Error after upgrading pip: cannot import name ' ...
This error mostly occurs when you have accidentally upgraded the pip in our system. · It appears when pip and unpack_url are used...
Read more >
Error after upgrading pip cannot import name main
Whenever I am trying to install any package using pip, I am getting this import error: dey@niroj-notebook:~$ pip3 install numpy Traceback ...
Read more >
[Solved] pip Import Error: cannot import name main
Simply speaking, this problem usually occurs when the version upgrade. Solved. First, we need to fix the "pip3" file. sudo vim /usr/bin/pip3.
Read more >
Error after upgrading pip: cannot import name 'main' - Intellipaat
The reason why you are getting import errors while trying to install any package using pip is that you must have upgraded your...
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