streamlit: [Regression][Conda] ModuleNotFoundError: No module named 'streamlit.cli'
Conda: 4.14.0 Python: 3.9.13
After upgrading to versions 1.12.0 and 1.12.2, Streamlit no longer launches.
streamlit run _gui_streamlit.py
Traceback (most recent call last):
File "/home/platon/miniconda3/bin/streamlit", line 6, in <module>
from streamlit.cli import main
ModuleNotFoundError: No module named 'streamlit.cli'
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 17
Experienced this issue today. I did previously have Anaconda installed. While it was installed, I later installed Spyder separately for a later version. I also installed miniconda (what a mess!). I uninstalled all of the above and installed Spyder and Miniconda. Installed streamlit. Tried to run a sample Python script ans was presented with the error:
Traceback (most recent call last): File “C:\Users\David.conda\envs\spyder-env\Scripts\streamlit-script.py”, line 6, in <module> from streamlit.cli import main ModuleNotFoundError: No module named ‘streamlit.cli’
I tried the suggestion to uninstall and reinstall streamlit and had the same issue. I fixed it by editing the streamlit-script.py file. I changed line 6 from streamlit.cli to streamlit.web.cli. as suggested by amaiya above. Hope this helps somebody.
Hi @PlatonB , I just did a clean install of miniconda and did a
streamlit hello. It seemed to work. I also did apip install streamlit==1.12.0pip install streamlit --upgradestreamlit helloand I couldn’t reproduce the error. Are you sure something is not going on with your environment? Maybe try uninstalling and installing streamlit?
awesome! had the same issues as you described and the suggested update worked for me. thanks!
It was moved to
streamlit.web.cli.Hey @PlatonB,
Thanks for reporting this. This issue was caused by the
conda-forgedistribution of Streamlit not being supported in the same official capacity as our PyPI distribution (it’s technically community supported), so we didn’t catch that a refactor of some of the streamlit internals broke the conda-forge distribution. I have a PR out to fix it (https://github.com/conda-forge/streamlit-feedstock/pull/57) and hope to get it checked-in in the next day or so.Note that we’re currently working with the anaconda team to get streamlit into the conda default channel (version 1.11.1 is in conda defaults, but we still need to work out getting new versions into conda defaults as they’re released to PyPI), so once that’s done we’ll have more guarantees around the stability of conda release of Streamlit.
(CC @kmcgrady)