i got error message No module named ‘tensorflow’, this is my requiremnent.txt file content
beautifulsoup4==4.12.2
keras==2.12.0
matplotlib==3.7.2
numpy==1.24.3
pandas==1.5.3
Requests==2.31.0
scikit_learn==1.2.2
streamlit==1.26.0
tensorflow==2.12.0
openpyxl==3.1.2
cryptocmd==0.6.4
xlsxwriter==3.1.1
This is the log
2024-02-08 17:00:42.035 Uncaught app exception
Traceback (most recent call last):
File “/home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py”, line 565, in _run_script
exec(code, module.dict)
File “/mount/src/cryptocurrency-predicition-app/project/main.py”, line 9, in
from keras.models import load_model
File “/home/adminuser/venv/lib/python3.11/site-packages/keras/init.py”, line 21, in
from keras import models
File “/home/adminuser/venv/lib/python3.11/site-packages/keras/models/init.py”, line 18, in
from keras.engine.functional import Functional
File “/home/adminuser/venv/lib/python3.11/site-packages/keras/engine/functional.py”, line 24, in
import tensorflow.compat.v2 as tf
ModuleNotFoundError: No module named ‘tensorflow’
2024-02-08 17:00:42.186 503 GET /script-health-check (10.12.48.32) 169.23ms
Could you try out with a small subset of libraries and then incrementally add the others afterwards (also make sure to reboot the app afterwards to ensure that the library gets installed).
Your requirements.txt works for me. Sometimes streamlit cloud doesn’t pick the changes to requirements.txt until you reboot or redeploy the application.
It’s something that I would typically try if the bulk of libraries provided in requirements.txt file does not work. This would help to rule out which one works and which one does not.
As also mentioned earlier, it’s also worth trying to reboot the app after changes is made to the requirements.txt file in order to ensure that it gets installed.
@Goyo confirmed that your requirements.txt works, perhaps you can try rebooting the app.