Error with from plotly.tools import FigureFactory. ModuleNotFoundError: No module named 'plotly'

My app stopped working once I deployed it in the Streamlit Community Cloud. Here’s the link to the requirements file sampledashboard/requirements at main · anaghavenugopal/sampledashboard · GitHub

I tried working around the version of plotly. I’m looking at identifying the issue.

Adding the logs below.

[13:15:10] 📦 Processed dependencies!


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





2023-01-05 13:15:20.104 Uncaught app exception

Traceback (most recent call last):

  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script

    exec(code, module.__dict__)

  File "/app/sampledashboard/code_dashboard.py", line 4, in <module>

    from plotly.tools import FigureFactory as ff

ModuleNotFoundError: No module named 'plotly'

2023-01-05 13:15:20.473 Uncaught app exception

Traceback (most recent call last):

  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script

    exec(code, module.__dict__)

  File "/app/sampledashboard/code_dashboard.py", line 4, in <module>

    from plotly.tools import FigureFactory as ff

ModuleNotFoundError: No module named 'plotly'

2023-01-05 13:15:21.862 Uncaught app exception

Traceback (most recent call last):

  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script

    exec(code, module.__dict__)

  File "/app/sampledashboard/code_dashboard.py", line 4, in <module>

    from plotly.tools import FigureFactory as ff

ModuleNotFoundError: No module named 'plotly'

2023-01-05 13:15:23.281 Uncaught app exception

Traceback (most recent call last):

  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script

    exec(code, module.__dict__)

  File "/app/sampledashboard/code_dashboard.py", line 4, in <module>

    from plotly.tools import FigureFactory as ff

ModuleNotFoundError: No module named 'plotly'

2023-01-05 13:35:28.850 Uncaught app exception

Traceback (most recent call last):

  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script

    exec(code, module.__dict__)

  File "/app/sampledashboard/code_dashboard.py", line 4, in <module>

    from plotly.tools import FigureFactory as ff

ModuleNotFoundError: No module named 'plotly'

[13:41:59] 🐙 Pulling code changes from Github...

[13:42:00] 📦 Processing dependencies...

[13:42:00] 📦 Processed dependencies!

[13:42:02] 🔄 Updated app!

2023-01-05 13:42:14.521 Uncaught app exception

Traceback (most recent call last):

  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script

    exec(code, module.__dict__)

  File "/app/sampledashboard/code_dashboard.py", line 4, in <module>

    from plotly.tools import FigureFactory as ff

ModuleNotFoundError: No module named 'plotly'

2023-01-05 14:01:51.379 Uncaught app exception

Traceback (most recent call last):

  File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script

    exec(code, module.__dict__)

  File "/app/sampledashboard/code_dashboard.py", line 4, in <module>

    from plotly.tools import FigureFactory as ff

ModuleNotFoundError: No module named 'plotly'

Your requirements file does not appear to have a file extension. Make sure it is named requirements.txt to get recognized correctly. You may need to reboot your app after changing the requirements file.

If you are still having problems after that, consider reducing the requirements file down to just the few relevant lines.

2 Likes

Thanks for pointing that out. It worked! The issue was with the extension.

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