AttributeError: module 'pip' has no attribute 'main'如何解决?
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'. ...
展开
我有更好的答案
3条回答
由于pip 10版本中没有main(),如果在不降级的情况下,修改这个文件
C:\Program Files\JetBrains\PyCharm Community Edition 2017.3.3\helpers\packaging_tool.py
在头部加上
1
|
import
pip._internal as pip_new
|
然后分别修改文件中的这两行中的pip
1
2
|
return
pip.main([
'install'
]
+
pkgs)
return
pip.main([
'uninstall'
,
'-y'
]
+
pkgs)
|
为
1
2
|
return
pip_new.main([
'install'
]
+
pkgs)
return
pip_new.main([
'uninstall'
,
'-y'
]
+
pkgs)
|