I have some small test scripts which i want to use in torizon Verdin AM62 module which require the pyserial module.
I can’t seem to install the module as i constantly get the "
error: could not create ‘/usr/lib/python3.10/site-packages/serial’: Read-only file system
" error.
Is it possible to install this module outside the use of docker containers or not?
Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!
Did you like my answer?
On TorizonCore, the root filesystem is read-only by design to ensure system stability and integrity. This is why you are encountering the “Read-only file system” error when trying to install the pyserial module directly on the system.
To use pyserial or any other Python module, the recommended approach is to use Docker containers. Containers provide a flexible and isolated environment where you can install and run your applications without modifying the underlying system.
Here’s a brief guide on how to set up a Docker container with pyserial on your Verdin AM62 module:
Create a Dockerfile:
Create a file named Dockerfile with the following content:
FROM torizon/python:3.10-slim-bullseye
RUN pip install pyserial
COPY your_script.py /usr/src/app/
CMD ["python", "/usr/src/app/your_script.py"]
Build the Docker Image:
On your development PC, navigate to the directory containing the Dockerfile and run:
docker build -t my-python-app .
Transfer the Docker Image to the Verdin Module:
Save the Docker image to a tar file and transfer it to the Verdin module:
docker save my-python-app -o my-python-app.tar
scp my-python-app.tar torizon@<VERDIN_IP>:/home/torizon/
Load the Docker Image on the Verdin Module:
SSH into the Verdin module and load the Docker image:
Out of curiosity, what kind of test scripts are you trying to run outside of the container? And similarly, why do they need to be done outside of the container?
They are nothing special, just some UART communication testing scripts.
It just that the whole Toradex, Embedded Linux in combination with Docker construction is very new to me and it seemed me simpler to just run the scripts from root o.s. since i just want to run them every now and then for debugging purposes.
On previous experiences with linux systems i was able to just install packages when needed and run the test scripts without a docker like system.
But as i understand it the design of the Torizon o.s. forces the use of docker containers for application development, now that i know this i’ll need to work with it i guess.