问题:
PyCharm IDE 创建项目或引入库提示 NameError: name 'pip' is not defined 问题解决方案
处理方法:
修改PyCharm 安装目录下文件:
PyCharm 2017.3\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 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)
来源:oschina
链接:https://my.oschina.net/u/4386697/blog/3882142