解决pycharm 无法加载pip安装包报错:python packing tools not found. install packing tools

  1. Linux下打开 /opt/pycharm-xxxxx/helpers/packaging_tool.py
    windows下打开 C:\Program Files\JetBrains\PyCharm 2017.1.1\helpers\packaging_tool.py
  2. 找到下方代码:
def do_install(pkgs):
    try:
        import pip
    except ImportError:
        error_no_pip()
    return pip.main(['install'] + pkgs)

def do_uninstall(pkgs):
   try:
        import pip
    except ImportError:
        error_no_pip()
    return pip.main(['uninstall', '-y'] + pkgs)
  1. 修改为:
def do_install(pkgs):
    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: 
        from pip._internal import main 
    except Exception: 
        from pip import main 
    except ImportError: 
        error_no_pip() 
    return main(['uninstall', '-y'] + pkgs)
  1. 此时打开pycharm 就能加载到pip安装包了。
当你安装了Python 3.10.4并在PyCharm中设置后,出现"unsupported Python 3.1"的报错是因为你所使用的PyCharm版本较低。 这个问题可以通过两种解决方案来解决。一种是降低Python环境的版本,取消使用3.10,改用3.7或者3.8等较低版本。另一种是下载较高版本的PyCharm。 如果你必须使用Python 3.10,那么你可以选择卸载PyCharm 2019并安装一个较高版本的PyCharm。 这样,当你安装并打开较高版本的PyCharm后,它将能够识别Python 3.10环境,从而解决了"unsupported Python 3.1"的报错问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [pycharm unsupported Python 3.1](https://blog.csdn.net/chanelwtt/article/details/123848162)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* *3* [pycharm unsupported Python 3.1报错pycharm无法识别python 3.10](https://blog.csdn.net/weixin_44346972/article/details/129658688)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值