简体   繁体   中英

Debian package of Python Application not working on Raspbian Bullseye

I built a debian package of my Python 3 Application using dh-virtualenv. On Raspbian Buster everything works fine but with the recent release of Bullseye I want the package to be compatible.

Sadly when I install the.deb under Bullseye, all my custom Python packages are missing. Running the Application throws a ModuleNotFoundError. I realised that the sys.path list did not contain the path to the site-packages of the virtualenv (which under Buster it does), so I appended it manually. This fixed the ModuleNotFoundError for most of the Python packages. However my application depends on some CPython packages as well and all those are still missing.

Running path/to/virtualenv/bin/pip3 list showed that they are not installed although I find all the correct.so and.dist-info files under the site-packages. Under Buster the same command listed all the extensions as expected.

My guess is that the problem is caused by different Python versions being used. Buster uses 3.7 and Bullseye uses 3.9. Do you have any ideas what could cause this problem and how I could fix it?

Thanks a lot Nathan

I found the core of the problem.
Bullseye is using python 3.9 instead of busters python 3.7.
So sys.path does not contain the correct path by default.

For now I am fixing this by installing python 3.9 on my Buster build machine and tell the /debian/rules file to use python 3.9.
Then I manually append the correct path.

sys.path.append('/path/to/debian-package/lib/python3.9/site-packages')

Bullseye and Buster also use different versions of libffi (foreign function interface).
So since the CPython packages are depending on libffi, they do not get installed correctly.
I fix this by installing libffi 7 on Buster.

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