'ModuleNotFoundError: No module named 'streamlit.cli'

I have an error when I deploy streamlit app on Heroku. How can I deal with ?

something error like this



Solution 1:[1]

You need to do the following steps:

  1. Create the virtualenv.
  2. Activate virtualenv.
  3. Then, you need to install the following packages:
pip install streamlit
pip install networkx

You would also install any other dependencies you need to run your script as well before running:

streamlit run yourscript.py

Solution 2:[2]

This happens when you Install multiple streamlit packages from different folders like when you cloned a project and you install their requirements in your global environment In this case best possible thing that can be done is to uninstall streamlit dependencies present in your system by

pip uninstall streamlit

The install it again using,

pip install streamlit

It should remove all the conflicts and your application should work now. and remember to install the new requirements in your virtual environment if you install all the requirements in your global environments these conflicts occur.

then simply run streamlit run command using

streamlit run app.py

All things should work fine now.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Nitin
Solution 2 Puranjay Kwatra