Modulenotfounderror: No Module Named 'Streamlit. Cli'
I Have an Error When I Deploy Streamlit App on Heroku. How Can I Deal with? 5 Answers This Happens When You Install Multiple Streamlit Packages from Different...
I have an error when I deploy streamlit app on Heroku. How can I deal with ?
5 Answers
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.
Try upgrading streamlit (this worked for me)
pip install --upgrade streamlit
Otherweise reinstall
pip uninstall streamlit
pip install streamlit
Updating the answer here for future users.
The package has been moved to streamlit.web module. So the current way is,
import streamlit.web.cli as stcli
You need to do the following steps:
- Create the virtualenv.
- Activate virtualenv.
- 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
Open Anaconda and click on Environments Then click on Play button and then click on Open Terminal
If you use Python 3 then install apt pip through:
sudo apt-get install python3-pip
Then Install pipenv through
pip3 install pipenv
Then you can install streamlit through:
pipenv install streamlit
You can run python files through streamlit as usual:
streamlit run my_file.py
Create a new environment with streamlit
Directly go to the folder where your project is located, click on the address bar then click on "Copy link as text", then change your working directory through
cd /your_copied_path
Create a new pipenv environment in that folder
pipenv
You can again install streamlit through pipenv:
pipenv install streamlit
Then you can just open your streamlit python file:
streamlit my_file.py
If this answer was helpful you can just like by clicking heart
Thanks for reading!!!