Python pip3 throws ModuleNotFoundError: No module named 'pip'

I have both python 2 and 3 and pip 2 and 3 installed, and all had been working fine. I tried installing graph-tools (https://git.skewed.de/count0/graph-tool/wikis/installation-instructions) using port install py-graph-tool, and it seems to have messed with my installations.

Specifically, I can no longer install packages with pip3, e.g.:

$ pip3 install networkx
Traceback (most recent call last):
  File "/Users/me/bin/pip3", line 8, in <module>
    from pip import main
ModuleNotFoundError: No module named 'pip'

even though

$ which pip
/Users/me/bin/pip

$ which pip3
/Users/me/bin/pip3

Less immediately, I have had similar problems (I assume) with different Python installations interfering with each other... I have done some searching to better understand this problem, but anyone willing to explain the basics or point to some good explanations online, I would be grateful!

Upvotes: 2

Views: 8374

Answers (1)

Purple Haze
Purple Haze

Reputation: 550

You can manually install pip3

wget https://bootstrap.pypa.io/get-pip.py
sudo python3.6 get-pip.py

Upvotes: 1

Related Questions