更新pip之后实蓬,Pycharm安裝package出現(xiàn)報(bào)錯(cuò):module 'pip' has no attribute 'main'
找到安裝目錄下 helpers/packaging_tool.py文件,找到如下代碼:
修改為如下统倒,保存即可寨典。
def do_install(pkgs):
try:
# import pip
try:
from pip._internalimport main
except Exception:
from pipimport main
except ImportError:
error_no_pip()
return main(['install'] + pkgs)
def do_uninstall(pkgs):
try:
???? # import pip
try:
from pip._internalimport main
except Exception:
from pipimport main
except ImportError:
error_no_pip()
return main(['uninstall','-y'] + pkgs)
轉(zhuǎn)自:https://www.cnblogs.com/jackadam/p/9055122.html