Pycharm安装第三方包报错
使用Pycharm安装第三方包的时候出现下方类似错误
“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 ‘D:************************’.”时,莫慌,一步一步来!!!
首先在Pycharm配置文件夹中找到“packaging_tool.py”文件(我的文件路径是D:\Pycharm\PyCharm Community Edition 2020.2.3\plugins\python-ce\helpers,仅供参考)
修改方法:do_install和do_uninstall
def do_install(pkgs):
try:
try:
from pip._internal import main
except Exception:
from pip import main
except ImportError:
error_no_pip()
return main(['install'] + pkgs)
def do_uninstall(pkgs):
try:
try:
from pip._internal import main
except Exception:
from pip import main
except ImportError:
error_no_pip()
return main(['uninstall', '-y'] + pkgs)
指路原博主解决方案
接下来只需要重新打开设置,找到你要下载的第三方包和依赖包就可以开开心心写python程序咯!!!