ModuleNotFoundError: No module named 'networkx'

I am running my Streamlit application locally, and it works well. However, when I try to deploy it to Streamlit Cloud by linking it to my GitHub repository (repository link: GitHub - warthon-190399/djia), I encounter an issue. It indicates that networkx is not installed, although it is installed on my local system (which is evident since it runs locally). The specific error message is as follows. PS: I am using Python 3.11 and Streamlit 1.29:

[23:34:33] :package: Processed dependencies!

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

2023-12-02 23:34:41.025 Uncaught app exception

Traceback (most recent call last):

File “/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py”, line 534, in _run_script

exec(code, module.__dict__)

File “/mount/src/djia/script_database.py”, line 2, in

import networkx as nx

ModuleNotFoundError: No module named ‘networkx’

[23:34:41] :exclamation:

2023-12-02 23:34:41.222 503 GET /script-health-check (10.12.146.32) 204.67ms

2023-12-02 23:34:46.039 Uncaught app exception

Traceback (most recent call last):

File “/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py”, line 534, in _run_script

exec(code, module.__dict__)

File “/mount/src/djia/script_database.py”, line 2, in

Hi @warthon-190399, welcome to the community! :wave:

There’s a typo in your dependency file name:

You need to rename the file to requirements.txt and reboot the app on Community Cloud for the dependencies to be installed.

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