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

pip3 -V yields: "ImportError: 'module' object has no attribute 'main'" #5591

Closed
leonjessen opened this issue Jul 10, 2018 · 7 comments
Closed
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@leonjessen
Copy link

  • Pip version: pip -V "pip 10.0.1", pip2 -V "pip 1.5.4"
  • Python version: python --version "Python 2.7.6", python3 --version "Python 3.4.3"
  • Operating system: 14.04.1-Ubuntu

I simply cannot get pip to function:

$ pip -V
pip 10.0.1 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)
$ pip2 -V
pip 1.5.4 from /usr/lib/python2.7/dist-packages (python 2.7)
$ pip3 -V
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/pkg_resources/__init__.py", line 2388, in resolve
    return functools.reduce(getattr, self.attrs, module)
AttributeError: 'module' object has no attribute 'main'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/pip3", line 9, in <module>
    load_entry_point('pip==9.0.3', 'console_scripts', 'pip3')()
  File "/usr/local/lib/python3.4/dist-packages/pkg_resources/__init__.py", line 547, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/local/lib/python3.4/dist-packages/pkg_resources/__init__.py", line 2720, in load_entry_point
    return ep.load()
  File "/usr/local/lib/python3.4/dist-packages/pkg_resources/__init__.py", line 2380, in load
    return self.resolve()
  File "/usr/local/lib/python3.4/dist-packages/pkg_resources/__init__.py", line 2390, in resolve
    raise ImportError(str(exc))
ImportError: 'module' object has no attribute 'main'

I may have mixed up using apt-get and pip to install and upgrade pip and now my system seem to be caught in a weird state, where I cannot get the most recent version of pip and keep running into these main associated errors.

I have spend several days googling and trying to fix the issue with no luck, so any help is greatly appreciated!

@pradyunsg
Copy link
Member

This is a case of #5599.

There's a list of related issues over on that issue -- I expect you'd find some useful information in those.

@pradyunsg pradyunsg added the S: needs triage Issues/PRs that need to be triaged label Jul 23, 2018
@xavfernandez
Copy link
Member

Closing in favor of #5599

@xavfernandez xavfernandez removed the S: needs triage Issues/PRs that need to be triaged label Oct 16, 2018
@sentientmachine
Copy link

I got this same error running pip3 install whatever because somehow my pip3 got bugged. The final solution was a forced purge and force upgrade pip3 using these commands:

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py --force-reinstall

Apparently one can have multiple pip3's on a system, and they can fight each other over turf.

@RoboEvangelist
Copy link

I have the same issue.
By the way, @leonjessen looks like the guy from veritasium

@leonjessen
Copy link
Author

I'm not though @RoboEvangelist 👍

I gave up on this issue and changed the to-do task from "Fix pip@14.04" to "Upgrade Ubuntu@18.04"

@RoboEvangelist
Copy link

Actually, my solution was to remove all things python-related, and reinstall them. Now everything works again in my computer. I have Ubuntu 16.04

@lock
Copy link

lock bot commented May 30, 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 auto-locked Outdated issues that have been locked by automation label May 30, 2019
@lock lock bot locked as resolved and limited conversation to collaborators May 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

No branches or pull requests

5 participants