Getting an error "'streamlit' is not recognized as an internal or external command, operable program or batch file."

I solved the issue by doing this on Windows 10 :

py -m streamlit run filename.py
2 Likes

Thanks, it worked!

1 Like
  1. cd on CMD to the location where your file.py is located.
  2. On the CMD, instead of typing streamlit run file.py type python -m streamlit run file.py
1 Like

Hello friend, I’m using the commands infrmado and it runs but it doesn’t create the page, can you help?

Thanks. it worked for me

You are welcome!!!

Thank you. That solved my problem.

  • search ā€œenvironment variablesā€ in start button then klik environment variables >>> klik edit on PATH variable
  • klik NEW then add C:\Users*Your User*\AppData\Local\Programs\Python\Python39
  • klik NEW then add C:\Users\user\AppData\Local\Programs\Python\Python39\Scripts

open cmd
pip install streamlit
pipenv install streamlit

I’ve spent hours trying to fix this, looked at all the solutions on this page, and yours is the one that worked (especially since I needed admin access for some of the other ones). Thank you so much! I was installing Streamlit on a new computer, and never needed ā€œpython -mā€ on the old one.

use the command:
python -m streamlit hello

2 Likes

I was stuck on this problem for more than 8 hours with an upcoming deadline…Thanks a lot this completely solved it!

Worked for me!

Thanks I lost 3 hours on this :heart:

1 Like

I also lost unnecessary hours on this until using that -m command. Would be really nice to know why though. Anyway, Thank You!

2 posts were split to a new topic: PySpark installation issue on Streamlit Cloud

worked like magic! Thanks a lot!

It worked for me, tkx

1 Like

Hi there,

This worked for me, but I added two variables on Path (I’M USING WIN 10):

C:\Users\name\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts

and

C:\Users\name\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310

The best practice is to do your pip install after you activate your conda environment

conda create --name streamlit  python=3.8
conda activate streamlit  
pip3 install deta

Thank you so much!