WIN10系统pycharm 虚拟环境下pip install 失败问题
使用pycharm工具下载安装flask依赖的包的时候报错,pycharm中event log detail提示如下。
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 'F:\Users\hp\PycharmsProjects\untitled3\Scripts\python.exe'.
提示pycharm工具中的python脚本C:\Program Files\JetBrains\PyCharm 2017.3.4\helpers\packaging_tool.py 110行报错。
def do_install(pkgs):
try:
import pip
print 11111
except ImportError:
error_no_pip()
return pip.main(['install'] + pkgs)
然后在虚拟环境中的python解释器import pip做了测试
发现果然缺少main方法。
然后使用正常环境中的python解释器查看pip模块。
发现是正常的。
cp 正常python环境中pip的目录C:\Python27\Lib\site-packages
到虚拟环境中F:\Users\hp\PycharmsProjects\untitled3\Lib\site-packages目录替换不全的pip包。解决问题。
使用pycharm中弹出来的下载依赖包界面可以正常下载python依赖包了。