Streamlit cloud imports

Thank you Streamlit Community!

I keep having issues with imports and often when I try to separate concerns and use different files which are imported into the main file. My app is stored in github and hosted on the Streamlit Comunity Cloud. I have added the packages to Requirments.txt file , cleared cash, rebooted, used a codespace push /sync and still got the error →

Log trace:

[ UTC ] Logs for innovaworld.streamlit.app/
────────────────────────────────────────────────────────────────────────────────────────
[10:32:29] :rocket: Starting up repository: ‘first_streamlit_app’, branch: ‘main’, main module: ‘streamlit_app.py’
[10:32:29] :octopus: Cloning repository…
[10:32:30] :octopus: Cloning into ‘/mount/src/first_streamlit_app’…

[10:32:30] :octopus: Cloned repository!
[10:32:30] :octopus: Pulling code changes from Github…
[10:32:31] :package: Processing dependencies…
Check if streamlit is installed
cat: /mount/admin/install_path: No such file or directory

──────────────────────────────── Installing Streamlit ──────────────────────────────────

Using uv pip install.
Using Python 3.14.5 environment at /home/adminuser/venv
Resolved 42 packages in 472ms
Prepared 42 packages in 1.79s
Installed 42 packages in 300ms

  • altair==6.1.0
  • anyio==4.13.0
  • attrs==26.1.0
  • blinker==1.9.0
  • cachetools==7.1.4
  • certifi==2026.5.20
  • charset-normalizer==3.4.7
  • click==8.4.1
  • gitdb==4.0.12[2026-05-28 10:32:34.723553]
  • gitpython==3.1.50
  • h11==0.16.0
  • httptools==0.8.0
  • idna==3.16
  • itsdangerous==2.2.0
  • jinja2==3.1.6
  • jsonschema==4.26.0
  • jsonschema-specifications[2026-05-28 10:32:34.723799] ==2025.9.1
  • markupsafe==3.0.3
  • narwhals==2.21.2
  • numpy==2.4.6
    [2026-05-28 10:32:34.723930] + packaging==26.2
  • pandas==3.0.3
  • pillow==12.2.0
  • [2026-05-28 10:32:34.724080] protobuf==7.35.0
  • pyarrow==24.0.0
  • pydeck==0.9.2
  • python-dateutil==2.9.0.post0
  • python-multipart==0.0.29
  • referencing==0.37.0
  • requests==2.34.2
    +[2026-05-28 10:32:34.724341] rpds-py==0.30.0
  • six==1.17.0
  • smmap==5.0.3
  • starlette==1.1.0
  • streamlit==1.57.0[2026-05-28 10:32:34.724459]
  • tenacity==9.1.4
  • toml==0.10.2
  • typing-extensions==4.15.0[2026-05-28 10:32:34.724558]
  • urllib3==2.7.0
  • uvicorn==0.48.0
  • [2026-05-28 10:32:34.724680] watchdog==6.0.0
  • websockets==16.0

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

[10:32:35] :package: Processed dependencies!
cat: /mount/admin/install_path: No such file or directory
2026-05-28 10:32:37.746 Uvicorn server started on 0.0.0.0:8501

2026-05-28 10:33:28.139 Uncaught app execution
Traceback (most recent call last):
File “/home/adminuser/venv/lib/python3.14/site-packages/streamlit/runtime/scriptrunner/exec_code.py”, line 129, in exec_func_with_error_handling
result = func()
File “/home/adminuser/venv/lib/python3.14/site-packages/streamlit/runtime/scriptrunner/script_runner.py”, line 689, in code_to_exec
exec(code, module.dict) # noqa: S102
~~~~^^^^^^^^^^^^^^^^^^^^^^^
File “/mount/src/first_streamlit_app/streamlit_app.py”, line 12, in
import plotly.express as px
ModuleNotFoundError: No module named ‘plotly’
2026-05-28 10:34:56.348 Uncaught app execution
Traceback (most recent call last):
File “/home/adminuser/venv/lib/python3.14/site-packages/streamlit/runtime/scriptrunner/exec_code.py”, line 129, in exec_func_with_error_handling
result = func()
File “/home/adminuser/venv/lib/python3.14/site-packages/streamlit/runtime/scriptrunner/script_runner.py”, line 689, in code_to_exec
exec(code, module.dict) # noqa: S102
~~~~^^^^^^^^^^^^^^^^^^^^^^^
File “/mount/src/first_streamlit_app/streamlit_app.py”, line 12, in
import plotly.express as px
ModuleNotFoundError: No module named ‘plotly’
2026-05-28 10:35:35.757 Uncaught app execution
Traceback (most recent call last):
File “/home/adminuser/venv/lib/python3.14/site-packages/streamlit/runtime/scriptrunner/exec_code.py”, line 129, in exec_func_with_error_handling
result = func()
File “/home/adminuser/venv/lib/python3.14/site-packages/streamlit/runtime/scriptrunner/script_runner.py”, line 689, in code_to_exec
exec(code, module.dict) # noqa: S102
~~~~^^^^^^^^^^^^^^^^^^^^^^^
File “/mount/src/first_streamlit_app/streamlit_app.py”, line 12, in
import plotly.express as px
ModuleNotFoundError: No module named ‘plotly’
2026-05-28 10:35:49.259 Uncaught app execution
Traceback (most recent call last):
File “/home/adminuser/venv/lib/python3.14/site-packages/streamlit/runtime/scriptrunner/exec_code.py”, line 129, in exec_func_with_error_handling
result = func()
File “/home/adminuser/venv/lib/python3.14/site-packages/streamlit/runtime/scriptrunner/script_runner.py”, line 689, in code_to_exec
exec(code, module.dict) # noqa: S102
~~~~^^^^^^^^^^^^^^^^^^^^^^^
File “/mount/src/first_streamlit_app/streamlit_app.py”, line 12, in
import plotly.express as px
ModuleNotFoundError: No module named ‘plotly’
2026-05-28 13:42:29.584 Uncaught app execution
Traceback (most recent call last):
File “/home/adminuser/venv/lib/python3.14/site-packages/streamlit/runtime/scriptrunner/exec_code.py”, line 129, in exec_func_with_error_handling
result = func()
File “/home/adminuser/venv/lib/python3.14/site-packages/streamlit/runtime/scriptrunner/script_runner.py”, line 689, in code_to_exec
exec(code, module.dict) # noqa: S102
~~~~^^^^^^^^^^^^^^^^^^^^^^^
File “/mount/src/first_streamlit_app/streamlit_app.py”, line 12, in
import plotly.express as px
ModuleNotFoundError: No module named ‘plotly’

Hey there, thanks for sharing your detailed logs and welcome to the Streamlit community! :rocket: The error ModuleNotFoundError: No module named ‘plotly’ means that the plotly package isn’t being installed in your app’s environment on Streamlit Community Cloud, even though you’ve added it to your requirements.txt.

Here are the most common reasons and solutions for this issue:

  1. Check requirements.txt filename and location: Make sure your file is named exactly requirements.txt (all lowercase, no typos) and is placed in the root of your repository or in the same directory as your app’s entrypoint file. If you have multiple requirements files (like Pipfile, environment.yml, etc.), Streamlit Cloud will only use the first one it finds, so remove any extras if you want to use requirements.txt.
  2. Check for typos and duplicates: Ensure plotly is listed as plotly (not plotly.express or any other variant) and only appears once.
  3. Reboot your app after changes: After editing requirements.txt, commit and push your changes, then reboot your app from the Streamlit Cloud dashboard.
  4. Check logs for dependency processing: In the logs, look for a line like + plotly==X.Y.Z after “Processing dependencies!”—if it’s missing, Streamlit didn’t install plotly.

Here’s a minimal example of what your requirements.txt should look like:

streamlit
pandas
plotly

If you still see the error after these steps, please share your repo link and requirements.txt content so the community can help debug further. For more troubleshooting tips, see the official docs and related forum threads: App dependencies for your Community Cloud app, ModuleNotFoundError No module named - Streamlit Docs, and FAQ: ModuleNotFoundError.

Sources: