pythonpython-3.xpipubuntu-16.04nvidia-jetson

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


i encountered errors with trying to upgrade pip, and its setup tools. Appended below are the errors.

pip install -upgrade pip failing

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.

setup tools installlation failing

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.


So i have tried the many suggestions listd in this thread over at https://github.com/facebook/prophet/issues/418 but to no avail.

Does anyone know of a solution ? Thanks in advance !

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

Solution

  • I have had this issue before. pip requires the latest version of python to be working properly to work, however certain CPU architectures don't fully support it. you say your using an ARM based CPU which I think requires a different way of installing python. Pip will throw syntax errors when python is incompatible with your CPU arch. You may need to look into emulators or upgrading hardware.