futer_dream
futer_dream

Reputation: 21

No Module named pip when running it

When I use pip3 I get this error:

Traceback (most recent call last):
  File "/Library/Developer/CommandLineTools/usr/bin/pip3", line 7, in <module>
    from pip import main
ModuleNotFoundError: No module named 'pip'

I tried to reinstall PIP but still reported this error, but I use python3 -m ensurepip

It told me to install Xcode command line

$ python3 -m ensurepip
$ xcode-select: Failed to locate 'python3.9', requesting installation of command line developer tools.

Upvotes: 1

Views: 1314

Answers (2)

narwhal
narwhal

Reputation: 53

Try to install python3.9 as suggested by the terminal.

Upvotes: 0

RafaelMafra
RafaelMafra

Reputation: 76

I had this problem when I was trying to update the pip and it failed. This always works for me:

python get-pip.py

font: https://pip.pypa.io/en/stable/installation/

Upvotes: 1

Related Questions