Error installing requirements - Unable to deploy

Hi there,

I am having quite hard times in deploying an app through my GitHub repository (in which I have my main.py and a requirements.txt file). This is the error I keep receiving:

note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for matplotlib
× Encountered error while trying to install package.
╰─> matplotlib

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
WARNING: You are using pip version 22.0.3; however, version 22.3.1 is available.
You should consider upgrading via the '/home/appuser/venv/bin/python -m pip install --upgrade pip' command.
Checking if Streamlit is installed

────────────────────────────────────────────────────────────────────────────────────────

[15:10:01] ❗️ installer returned a non-zero exit code
[15:10:01] ❗️ Error during processing dependencies! Please fix the error and push an update, or try restarting the app.
[15:11:36] ❗️ Streamlit server consistently failed status checks
[15:11:36] ❗️ Please fix the errors, push an update to the git repo, or reboot the app.

These below are my requirements:
deta==1.1.0
keras==2.9.0
matplotlib==3.2.2
numpy==1.23.5
pandas==1.4.4
pandas_datareader==0.10.0
pandas_market_calendars==4.1.1
scikit_learn==1.1.3
streamlit==1.15.1

Could you please help me?
Thanks!

Use python <=3.9 or a recent version of matplotlib.

Hi,

I have upgraded matplotlib and the deployment goes a little bit further.
Unfortunately, I receive this error message (immediately after the completion of requirements):

[16:10:52] 🐍 Python dependencies were installed from /app/stocks/requirements.txt using pip.
Check if streamlit is installed
Streamlit is already installed
[16:10:53] 📦 Processed dependencies!

Collecting usage statistics. To deactivate, set browser.gatherUsageStats to False.




2022-11-27 16:11:06.431 Uncaught app exception
Traceback (most recent call last):
  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 564, in _run_script
    exec(code, module.__dict__)
  File "/app/stocks/main.py", line 9, in <module>
    from keras.layers import Dense, LSTM
  File "/home/appuser/venv/lib/python3.9/site-packages/keras/__init__.py", line 21, in <module>
    from tensorflow.python import tf2
ModuleNotFoundError: No module named 'tensorflow'

How is this even possible, considered that my app is running smoothly on the localhost web page (before the deployment)?

Thank you!

One possible scenario in which this could happen is if tensorflow is installed in your computer but not in the deployment environment.

Hi @Goyo,

So you think that Tensorflow might not be installed in the virtual environment of my main… I can double check that, but I don’t think so as I’ve used Pycharm in that specific project interpreter and added packages always to the same interpreter… Thanks for the suggestion, I will check it out ASAP and come back to you!

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.