Geeks, please accept the hero post of 2021 Microsoft x Intel hacking contest>>>
The following error occurred when using the IntelliJ idea tool pip to install things:
Action to modify:
Find the corresponding path to the file C:: (users, administrator, intellijidea, 2017.1, config, plugins, python, helpers, packaging_ tool.py
Source code:
def do_install(pkgs):
try:
import pip
except ImportError:
error_no_pip()
return pip.main(['install'] + pkgs)
def do_uninstall(pkgs):
try:
import pip
except ImportError:
error_no_pip()
return pip.main(['uninstall', '-y'] + pkgs)
After modification:
def do_install(pkgs):
try:
#import pip
try:
from pip._internal import main
except Exception:
from pip import main
except ImportError:
error_no_pip()
return main(['install'] + pkgs)
def do_uninstall(pkgs):
try:
#import pip
try:
from pip._internal import main
except Exception:
from pip import main
except ImportError:
error_no_pip()
return main(['uninstall', '-y'] + pkgs)
PS: delete PIP in the last return
If after modification
CMD: Python – M PIP install — upgrade pip
If not:
At this time, you can only install it manually
http://www.lfd.uci.edu/~gohlke/pythonlibs/ Search this website for what you need (yaml)
Select the corresponding WHL file, download and remember the location
CMD command: PIP installd: \% pyyaml-3.13-cp37-cp37m-win_ amd64.whl
Similar Posts:
- Handling method of PIP error in pycharm installation
- AttributeError: module ‘pip’ has no attribute ‘main’
- How to Solve pip3 ImportError: cannot import name ‘main’
- [Solved] Python Error: ModuleNotFoundError : No Module named ‘pip._internal’
- Tensorflow ImportError: DLL load failed with error code -1073741795
- The process of installing jupyter notebook on MAC
- [Solved] Tensorflow:ImportError: DLL load failed: The specified module cannot be found Failed to load the native TensorFlow runtime
- How to Solve ModuleNotFoundError: No module named ‘pip._internal’
- [Solved] Error caused by correspondence between tensorflow GPU version number and CUDA
- [Solved] pip and setuptools upgrade Error: Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-fH0Feg/pip/