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!!!
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.