Can't deploy on the cloud

My streamlit app runs fine locally on my computer, but it fails to deploy on streamlit cloud. Does anyone know how to fix it?
The error that I get is
Error during processing dependencies! Please fix the error and push an update, or try restarting the app.

When I pull the code from the github and run it locally, it works fine.
Thank you very much.

I got same thing but You can actually check which dependency. For me it was jinja. I had to do pip3 install jinja2==3.0.1

Thank you for your reply! Do you know, how could I check which dependency causes the problem?

Paste the entire error.

Hi @stepdasha :wave:

The issue was with including python=3.9.12 as a dependency. Streamlit Cloud runs your app in a virtual environment. Installing Python as a dependency will mean that the other dependencies will be installed in a virtual environment different than the one your app is running in. As such, none of your Python depdencies are installed in the same virtual env as app.py, causing import errors at runtime.

The solution is to:

  1. Delete your app on Streamlit Cloud
  2. Remove the - python=3.9.12 line from environment.yml so that the contents are:
    name: structure
    channels:
      - defaults
      - conda-forge
    dependencies:
    - pymol-open-source=2.5.0
    - tqdm=4.63.0
    - matplotlib=3.5.1
    - numpy=1.22.3
    - streamlit=1.11.1
    - pandas=1.4.2
    - biotite=0.34.0
    
  3. pymol in distance.py requires libGL to be installed as a Linux / apt-get dependency. To install it, create a packages.txt file in your repo containing:
    libgl1
    
  4. Re-deploy your app on Streamlit Cloud

Once you make the above changes, your app should successfully deploy! :balloon:

Thank you very much! It worked! May I ask, how did you understand what were the problems?

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