ModuleNotFoundError: No module named 'pip._internal', pip can not download the software solution

problem

After upgrading the new pip, whether locally or using anaconda environment, errors may occur when using pip download:  ModuleNotFoundError: No module named 'pip._internal'There may be a conflict with the old version, it may advance to uninstall the old version.

Solution 1

repair

python -m ensurepip
python -m pip install --upgrade pip

Solution 2

repair

sudo apt install --fix-missing python3-pip

Solution 3

Forced to re-install

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

Solution 4

No module named occur after you install anaconda 'pip._internal' likely to be in the installation process and the original pip local conflicts, you can change the file name replaced with the newly installed, then change it back again anaconda Bahrain

Solution 5

In fact, the new version of the module has been adjusted, find the corresponding error of bin / under pip / (such as mine is / var / scratch / wwang / anaconda3 / bin /), opened with vim:

Will from pip._internal import main commented, changed from pip import main save out just fine (NOTE: When using vim, enter the command line vim to specify the path / pip open a file, press after entering the i key to enter edit mode, changes have been made press the ESC , and then enter : wq to save and exit)

After that done with which pip check whether it is the correct path, the path is likely to invoke the legacy pip

carry out !
 

 

发布了80 篇原创文章 · 获赞 4 · 访问量 1万+

Guess you like

Origin blog.csdn.net/tscaxx/article/details/104253948