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']
----------------------------------------
参考
- https://www.cnblogs.com/dancesir/p/14201267.html
- https://stackoverflow.com/questions/61525119/error%2Dcommand%2Derrored%2Dout%2Dwith%2Dexit%2Dstatus%2D1%2Dpip%2Dinstall
- https://zhuanlan.zhihu.com/p/165909343