I’m trying to transfer a Flask web app to a Raspberry Pi 4b using Docker. The container runs flawlessly on AMD architecture. The ARM architecture is to be tested on the Raspberry. The creation of the image based on python3.12-bookworm and the container creation work without problems on the Raspberry. The container starts and runs. As soon as I call up a page from the website using a browser, I get the error message ‘internal server error’.
The following image shows the apache2/error.log from the container.
The directory /usr/local/lib/…./pydantic_core looks like this. There are obviously problems with ‘_pydantic_core.cpython-312-aarch64-linux-gnu.so’. Does anyone have a solution for this problem?
meanwhile i found, that Python is missing a symbol: /usr/local/lib/python3.12/site-packages/pydantic_core/_pydantic_core.cpython-312-aarch64-linux-gnu.so: undefined symbol: PyErr_GetRaisedException. But how can i fix that?
2
Answers
When you build Docker image, then it is built for the architecture of the machine on which the build process was running.
So what you try to do is running the WS GW Interface script, based on broken dependencies…
If I were you, I’d look through my requirements file and remove any system specific requirements and allow pip to decide which to install based on the current system. Sometimes when installing dependencies, they install system specific ones. Also, I’d try removing pydanctic from my requirements file completely since it is most likely being installed as a dependent dependency.