Python 解决: from pip import main ImportError: cannot import name 'main'

时间:2018-09-04 14:00:06   收藏:0   阅读:2059

此次报错是因为 pip 升级出的问题:

解决方案1:

python3 -m pip install 模块名

解决方案2:

进入 pip3 的文件夹 sudo vi /usr/bin/pip3 
修改:from pip import main 
为:from pip._internal import main

然后保存退出。 
再运行 pip3 install 模块名 就能成功了!

 

 

转自:https://blog.csdn.net/qq_33811662/article/details/80615353

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!