Home > Net >  apt-get install packages introduces lots of python errors on Ubuntu
apt-get install packages introduces lots of python errors on Ubuntu

Time:09-14

apt-get install -y my_package
Everything works until
Setting up my_package...
And lots of python errors like the below appeared:

Compiling ./ext/python3.9/lib/python3.9/site-packages/setuptools/installer.py ...
  File "./ext/python3.9/lib/python3.9/site-packages/setuptools/installer.py", line 77
    raise DistutilsError(str(e)) from e
                                    ^
SyntaxError: invalid syntax

I suspect it has something to do with python versions

ls -la /usr/bin/python
/usr/bin/python -> python2.7

CodePudding user response:

Based on the symptoms, sounds like a packaging bug.

It looks like the package's scripts are expecting python to be Python 3 and is thus inadvertently running Python 2's compileall against Python 3 files.

  • Related