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

Cannot import main from pip 18.0 #5672

Closed
jishanshaikh4 opened this issue Jul 30, 2018 · 6 comments
Closed

Cannot import main from pip 18.0 #5672

jishanshaikh4 opened this issue Jul 30, 2018 · 6 comments

Comments

@jishanshaikh4
Copy link

Environment: 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.

  1. Get package from this link https://files.pythonhosted.org/packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl.
  2. Then try run e.g.
    pip install scikit-learn
  3. 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

@pradyunsg
Copy link
Member

Please see #5599.

@jishanshaikh4
Copy link
Author

Thanks. @pradyunsg

@abhiTronix
Copy link

The Ubuntu's python-pip-9.0.1 installed(via apt get python-pip) is conflicting with Latest pip-18.0 provided by pypa. So sudo 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 system

@Aribido-Oluwaseun
Copy link

I couldn't find python-pip in site-packages

@denis-trofimov
Copy link

I couldn't find python-pip in site-packages

rm -rf ~/.local/lib/python*

@pradyunsg
Copy link
Member

Please see #5599, there's a lot of advice presented there.

@pypa pypa locked as resolved and limited conversation to collaborators Nov 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants