pip安装包时报了错误,信息如下:
Try to run this command from the system terminal. Make sure that you use the correct version of 'pip' installed for your Python interpreter located at 'C:\Users\Administrator\Desktop\pycharmDoc\Pict_Processing\venv\Scripts\python.exe'. ...
由于pip 10版本中没有main()造成的 ,如果在不降级的情况下,修改这个文件:
D:\PyCharm Community Edition 2017.3.3\helpers\packaging_tool.py
解决方案:
在头部加上
import pip._internal as pip_new
然后分别修改文件中的这两行中的pip
return pip.main(['install'] + pkgs)
return pip.main(['uninstall', '-y'] + pkgs)
修改后
return pip_new.main(['install'] + pkgs)
return pip_new.main(['uninstall', '-y'] + pkgs)