Pycharm在运行pip安装模块是报错如下:
解决方法:
找到安装路径下的packaging_tool.py文件修改如下:
我的路径为D:Program FilesJetBrainsPyCharm 2017.2.3helperspackaging_tool.py
原先:
修改后保存退出即可:
代码如下:
def do_install(pkgs): try: try: from pip._internal import main except Exception: from pip import main #import pip except ImportError: error_no_pip() return main(['install'] + pkgs) def do_uninstall(pkgs): try: try: from pip._internal import main except Exception: from pip import main #import pip except ImportError: error_no_pip() return main(['uninstall', '-y'] + pkgs)
注意:return 没有pip,然后缩进的问题。