Getting error when deploying app, but not when running it locally

Hello,

When I use the streamlit run *app_name*.py command, and I view it in the browser, the app functions perfectly fine. After I pushed the repo to Github for deployment, I followed the directions to deploy it using Streamlit.
However, I get an error on the live website despite the local version working fine.
This is what appears:

How can I go about fixing this?

Thanks!

1 Like

This is solved by adding a packages.txt file to install system-level dependencies:

1 Like

Is there a quick way to make a packages.txt file like there is with pipreq for requirements.txt? If not, how should I go about figuring out which packages should be added to the file? Thanks!

Update: I followed the directions in the thread and it solved that issue! However, I now have another error. Essentially, I am trying to create a webapp for my image classification Keras model and have an issue that appears when an image is trying to be classified. Specifically, the error I get is:

No, there isn’t. pipreqs as far as I know scans the Python code to understand the imports. However, there really isn’t a good way to know which drivers or other libraries outside of Python are required, since every install/compile toolchain can be different.

To clarify, does this work locally but not when deployed, or are you having trouble making the code work at all?

It works fine locally–just not when deployed.

I would check that you both have the same Python version and same package versions on both machines. When there are errors reading pickled files or other serialization formats, errors usually come from version mismatches.