简体   繁体   中英

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

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM