准备运行一份代码,是python2环境,需要pycharm配置到python2:本机环境如下:
prcharm版本 2017.3.4
python2.7
用pycharm 的虚拟环境加载第三方库的时候,例如numpy,直接报错:AttributeError: 'module' object has no attribute 'main'
如图:
Traceback (most recent call last):
File "H:\PyCharm\PyCharm Community Edition 2017.3.4\helpers\packaging_tool.py", line 192, in main
retcode = do_install(pkgs)
File "H:\PyCharm\PyCharm Community Edition 2017.3.4\helpers\packaging_tool.py", line 109, in do_install
return pip.main(['install'] + pkgs)
AttributeError: 'module' object has no attribute 'main'
尝试了:1重装pycharm,同版本
2:重装python2
3:升级pip,控制台升级