Gspread module not found error when deploying to streamlit.io

Hi,

When trying to deploy my streamlit app, I received the following error:

File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 556, in _run_script
    exec(code, module.__dict__)File "/app/project-three/run.py", line 1, in <module>
    import gspread

I made sure that the module is downloaded and installed in my Python coding environment, before trying to deploy to streamlit.it. What could be causing this?
Thanks in advance.

When you deploy to the cloud, you are then using an environment in the cloud to run your app.

Anything you need to pip install besides Streamlit to run your app needs to be included in a requirements.txt file alongside your main_app.py file. If there are other (non-python) things that the environment needs, you’ll need to deal with a packages.txt file, too.

1 Like

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