I am deploying my first app and have worked through a lot of debugging but have reached an problem that I am unable to solve. I have read several other posts here about the same issue but none of the solutions have been successful for me.
I keep getting this error:
ModuleNotFoundError: No module named 'tensorflow'
I have added tensorflow to both my requirements and packages .txt files both with and without the version number I am running on my local machine.
I am running Python 3.9.16 with tensorflow 2.11.0.
Here is a link to my public repot on GitHub where my notebook and files are located.
Welcome to the community!
You dont’t need the packages.txt for tensorflow, delete it.
The tensorflow version should be available for this python version.
Is tensorflow installed on your local machine?
What do you get with:
I appreciate you taking the time to run the app on your own
I am able to do streamlit run in my terminal and the app works fine!
However, when I run the app from my Github on streamlit.io from my apps list I keep getting package errors. I have pasted them below.
I am still pretty new at this so I am not sure how to point it in the right direction beyond the requirements.txt file.
Any advice would be very much appreciated!
Traceback (most recent call last):
File “/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py”, line 565, in _run_script
exec(code, module.dict)
File “/app/hotdogathon/hotdog.py”, line 8, in
from IPython.display import Image
ModuleNotFoundError: No module named ‘IPython’
Updating the app files has failed: git pull, cmd: sudo -u appuser GIT_SSH_COMMAND=‘ssh -i /home/appuser/.ssh/id_github -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o “LogLevel ERROR”’ git fetch origin && sudo -u appuser git reset --hard origin/main: error: exit status 128: error: unable to create file .streamlit/config.toml: Permission denied
fatal: Could not reset index file to revision ‘origin/main’.strong text
Uncaught app exception
Traceback (most recent call last):
File “/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py”, line 565, in _run_script
exec(code, module.dict)
File “/app/hotdogathon/hotdog.py”, line 7, in
import tensorflow as tf
ModuleNotFoundError: No module named ‘tensorflow’
I realized my app had not been updating as I made changes to it in Github (I probably should have known that). So I deleted it and added it again and it works!!!