pip install --upgrade pip 和 pip install --upgrade setuptools 均失败,错误代码为 1

pip install --upgrade pip and pip install --upgrade setuptools both failed with error code 1

我在尝试升级 pip 及​​其设置工具时遇到错误。 下面附上错误。

pip 安装-升级 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

我以前遇到过这个问题。 pip 需要最新版本的 python 才能正常工作,但是某些 CPU 架构并不完全支持它。您说您使用的是基于 ARM 的 CPU,我认为这需要不同的安装方式 python。当 python 与您的 CPU arch 不兼容时,Pip 将抛出语法错误。您可能需要查看模拟器或升级硬件。