streamlit: When "streamlit run" file doesn't exit and has no extension, error printout is weird

  1. Create a Python file and call it example (without .py)
  2. streamlit run example

Here’s what you get:

This error message is not a valid sentence: “Streamlit requires raw Python (.py) files, not .”

What’s happening is that the code is trying to write the file extension in the error message, but in this case the file has no extension.

We should instead say something like “Streamlit requires raw Python (.py) files, and the provided file has no extension.”

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 21 (3 by maintainers)

Most upvoted comments

The problem is probably in the path if it has folder title with space. For example, if your path is: C:/User/My Folder/main.py and you try to run it as: streamlit run C:/User/My Folder/main.py you get this Error: Streamlit requires raw Python (.py) files (the problem is in “My Folder” title). Try to run it as: streamlit run “C:/User/My Folder/main.py” and the problem would be solved. Cheers

I can fix this problem. If approved, I will make a pull request.

The problem is probably in the path if it has folder title with space. For example, if your path is: C:/User/My Folder/main.py and you try to run it as: streamlit run C:/User/My Folder/main.py you get this Error: Streamlit requires raw Python (.py) files (the problem is in “My Folder” title). Try to run it as: streamlit run “C:/User/My Folder/main.py” and the problem would be solved. Cheers

thanks! this work to me!

Thanks for volunteering @abhinand5, please feel free to take a shot at it and submit a PR.