ImportError: module 'pip' has no attribute 'main' 解决方案
在Mac的硬盘里找到Pycharm CE,右击“显示包内容”
contents/helpers/packaging_tool.py路径锁定目标文件
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 pip.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 pip.main(['uninstall', '-y'] + pkgs)
转自https://blog.csdn.net/qq_32618817/article/details/80370153