Hi all, I try to push the python Dockerfile to Balena cloud and it is successful in my local cmd. However, it shows the error in the balena Logs window that “ImportError: No module named pyaudio”. I am wondering that everything is setup in python and Dockerfile but why the application cannot run on balena cloud?
Could you share with us the Dockerfile to take a look?
You should add the command
pip install pyaudio to get it working and PyAudio seems not to work for Python versions above 3.7.
Please make sure that your local configuration matches this one that you’ve added to the Dockerfile. It would help if you first try to run this container in your local Docker instance before uploading it to BalenaCloud, to make sure it works as expected.
If I may ask, what kind of project are you building?
@georgiats I used
RUN apt-get install python -y
RUN apt-get install python3-pip -y
RUN pip3 install pyaudio
It runs perfectly on the local Python and successfully pushed to balena cloud. But I don’t know why it shows no module found on Logs windows
My guess here is that if you run
RUN apt-get install python -y then Python downloads v3.8, which doesn’t work well with pyaudio library, which has not been updated since 2017.
This issue is something that rather has to do the configuration and the libraries used than with any Balena related error.