【发布时间】:2022-01-11 11:48:03
【问题描述】:
我在尝试升级 pip 及其设置工具时遇到了错误。 下面附上错误。
pip install -upgrade pip 失败
pip install --upgrade pip
Collecting pip
Using cached https://files.pythonhosted.org/packages/da/f6/c83229dcc3635cdeb51874184241a9508ada15d8baa337a41093fab58011/pip-21.3.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-9msN4R/pip/setup.py", line 7
def read(rel_path: str) -> str:
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-9msN4R/pip/
You are using pip version 8.1.1, however version 21.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
设置工具安装失败
pip install setuptools
Collecting setuptools
Using cached https://files.pythonhosted.org/packages/e6/e2/f2bfdf364e016f7a464db709ea40d1101c4c5a463dd7019dae0a42dbd1c6/setuptools-59.5.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "setuptools/__init__.py", line 16, in <module>
import setuptools.version
File "setuptools/version.py", line 1, in <module>
import pkg_resources
File "pkg_resources/__init__.py", line 117
f"{v} is an invalid version and will not be supported in "
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-HXbHxE/setuptools/
You are using pip version 8.1.1, however version 21.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
所以我在https://github.com/facebook/prophet/issues/418 尝试了此线程中列出的许多建议,但无济于事。
有人知道解决方案吗?提前致谢!
System specs:
Ubuntu 16.04 LTS
NVIDIA Tegra X2 (nvgpu)/integrated
ARMv8 Processor rev 3 (v8l) × 4 ARMv8 Processor rev 0 (v8l) × 2
64bit
8GB RAM
【问题讨论】:
-
Ubuntu 16.04 已停产,最新版本的 pip 可能不支持那么旧的 python。
-
@jordanm 默认 python 是 3.5.9,但在运行 pip install --upgrade pip 之前我已经安装了 python 3.8。
-
@phd 我无法访问您提供的网址链接的帖子。我可以知道它是关于什么的吗?
-
@fatbronger *.com/a/65871131/7976758
标签: python python-3.x pip ubuntu-16.04 nvidia-jetson