ubuntu 升级python3.6后pip install 报错处理

python3.5升级3.6后 pip报错问题

pip报错

如果python成功升级后,发现pip 命令 报错,那么需要先卸载

apt-get remove python3-pip

apt-get autoremove

接着重新安装pip
sudo apt-get install python3-pip

安装完成pip后 有可能提示版本过低,那么需要执行升级
python3 -m pip install --upgrade pip

搞完后,查看pip版本
pip version, 如果pip命令没有,则试试pip3命令

pip install 时如果出现以下报错时, 需要升级 setuptools,升级后应该就正常了。不知道为什么 这块报错 网上搜索到的比较少。

pip install --upgrade setuptools

WARNING: Discarding https://pypi.tuna.tsinghua.edu.cn/packages/72/bb/8d72cfbd17f8353391ed8ba14c090f090df9cccdc31f3c624aa2e67cdcd6/adbutils-0.10.1.tar.gz#sha256=abdc72c15ec55b3a32821fabdd3456852d4d5fe5b5142a277bdb543e8efc0364 (from https://pypi.tuna.tsinghua.edu.cn/simple/adbutils/) (requires-python:>=3.5). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/9a/b9/93d42ca00ede42b447552fbb7d12fa9aa7b99d502e72d364d3f748033d63/adbutils-0.10.0.tar.gz (159 kB)
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-qdqpj0u8/adbutils_fe3e044961124543b6d7dc8a8fb14c19/setup.py'"'"'; __file__='"'"'/tmp/pip-install-qdqpj0u8/adbutils_fe3e044961124543b6d7dc8a8fb14c19/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-nnw8hz66
         cwd: /tmp/pip-install-qdqpj0u8/adbutils_fe3e044961124543b6d7dc8a8fb14c19/
    Complete output (17 lines):
    Couldn't find index page for 'pbr' (maybe misspelled?)
    No local packages or working download links found for pbr
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-qdqpj0u8/adbutils_fe3e044961124543b6d7dc8a8fb14c19/setup.py", line 19, in <module>
        setuptools.setup(setup_requires=['pbr'], python_requires='>=3.5', pbr=True)
      File "/usr/lib/python3.6/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/usr/local/lib/python3.6/dist-packages/setuptools-33.1.1-py3.6.egg/setuptools/dist.py", line 317, in __init__
      File "/usr/local/lib/python3.6/dist-packages/setuptools-33.1.1-py3.6.egg/setuptools/dist.py", line 372, in fetch_build_eggs
      File "/usr/local/lib/python3.6/dist-packages/setuptools-33.1.1-py3.6.egg/pkg_resources/__init__.py", line 846, in resolve
      File "/usr/local/lib/python3.6/dist-packages/setuptools-33.1.1-py3.6.egg/pkg_resources/__init__.py", line 1118, in best_match
      File "/usr/local/lib/python3.6/dist-packages/setuptools-33.1.1-py3.6.egg/pkg_resources/__init__.py", line 1130, in obtain
      File "/usr/local/lib/python3.6/dist-packages/setuptools-33.1.1-py3.6.egg/setuptools/dist.py", line 440, in fetch_build_egg
      File "/usr/local/lib/python3.6/dist-packages/setuptools-33.1.1-py3.6.egg/setuptools/command/easy_install.py", line 668, in easy_install
    distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('pbr')
    setup.py arguments: ['/tmp/pip-install-qdqpj0u8/adbutils_fe3e044961124543b6d7dc8a8fb14c19/setup.py', 'egg_info', '--egg-base', '/tmp/pip-pip-egg-info-nnw8hz66']
    ----------------------------------------

参考

  1. https://www.cnblogs.com/dancesir/p/14201267.html
  2. https://stackoverflow.com/questions/61525119/error%2Dcommand%2Derrored%2Dout%2Dwith%2Dexit%2Dstatus%2D1%2Dpip%2Dinstall
  3. https://zhuanlan.zhihu.com/p/165909343
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值