No module named 'pip._internal.cli.main'

Viewed 12626

Pip does not work. Error:

  File "C:\ProgramData\Anaconda3\Scripts\pip-script.py", line 6, in <module>
    from pip._internal.cli.main import main
ModuleNotFoundError: No module named 'pip._internal.cli.main' 

None of the solutions of related issues solves it. Should I reinstall anaconda and a hundred of site-packages? Is it an only solution?

5 Answers

try this on cmd:

python -m pip install --upgrade pip

Run the following command to solve the problem.

$ conda install -c conda-forge pip

try this :

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

Use pip3 instead of pip i.e. pip3 --version

Installation behavior On Windows 11 is different from that on Windows 10. Installing Python3.9 using miniconda is different from installing Python3.8 on Windowds 11. pip install -U did not work in Python3.8 on Windowd 11. Install Python3.9 on Windows 11. On WSL on Windows 11 and 10, all Python versions such as python3.8 and 3.9 work fine.

Related