Cannot import main from pip 18.0
See original GitHub issueEnvironment: Global Environment
- pip version: 18.0
- Python version: 3
- OS: Ubuntu 17.10 (Linux)
Description When upgraded from 9.0.3 to 18.0, it starts showing the following error constantly on each use of pip-
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
from pip import main
ImportError: cannot import name main
Expected behavior This should not be happen.
How to Reproduce
Upgrade pip from version 9 to latest as
pip install --upgrade pip
and you are unable to use any features of pip anymore.
- Get package from this link https://files.pythonhosted.org/packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl.
- Then try run e.g.
pip install scikit-learn
- ImportError occurs.
Output Following traceback:
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
from pip import main
ImportError: cannot import name main
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top 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 >ImportError cannot import name main in pip - Edureka
Hi Guys, I am getting this below error, when I am trying to install numpy in my system. $ pip3 ... import name...
Read more >[SOLVED] Error after upgrading pip: cannot import name 'main'
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 >[Solved] pip Import Error: cannot import name main
First, we need to fix the "pip3" file. Be careful! the suffix of "__main__. _main()" is "_main()" not "main()"!
Read more >How to solve ImportError: cannot import name 'main'
When I upgrade pip3 by typing sudo pip3 install -U pip and use the upgraded one, I get an error message ' ImportError:...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The Ubuntu’s
python-pip-9.0.1
installed(via apt get python-pip) is conflicting with Latestpip-18.0
provided by pypa. Sosudo rm -rf ~/.local/lib/python2.7/site-packages/
(Beware!) removes the ubuntu’s python-pip and resolves the problem. Only one pip can exist on the systemPlease see #5599.