Reputation: 5667
I have pip
installed and can clearly see the file (by using which pip
) but, when I go to actually run a command like pip install -r requirements.txt
(or even just pip
to get help), I get the following error:
Traceback (most recent call last):
File "/usr/local/bin/pip3", line 7, in <module>
from pip._internal import main
ModuleNotFoundError: No module named 'pip'
I get this whether I'm using pip 2 or 3. What is going on here? Any way to fix it without reinstalling the whole thing?
Upvotes: 2
Views: 332
Reputation: 5667
Succinct answer - I ran pip -m site
to see where my site packages are, and poked around in there and couldn't find pip. It must have gotten deleted...
This makes me wonder, though, why did pip disappear when I ran pip install --upgrade pip
as it instructed me to do! 🤔
Upvotes: 1
Reputation: 810
Force a reinstall by running
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py --force-reinstall
Upvotes: 2