can't import streamlit
See original GitHub issueSummary
Error: Streamlit requires raw Python (.py) files, not . I checked the file format, it is python, not others. The streamlit version is 0.56.0 The python version is 3.7
How can I solve this?
Steps to reproduce
What are the steps we should take to reproduce the bug:
- Go to ‘…’
- Click on ‘…’
- Scroll down to ‘…’
Expected behavior:
Explain what you expect to happen when you go through the steps above, assuming there were no bugs.
Actual behavior:
Explain the buggy behavior you experience when you go through the steps above. If applicable, add screenshots to help explain your problem.
Is this a regression?
That is, did this use to work the way you expected in the past? yes / no
Debug info
- Streamlit version: (get it with
$ streamlit version
) - Python version: (get it with
$ python --version
) - Using Conda? PipEnv? PyEnv? Pex?
- OS version:
- Browser version:
Additional information
If needed, add any other context about the problem here. For example, did this bug come from https://discuss.streamlit.io or another site? Link the original source here!
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Can't import streamlit
Hi,. I have used the following command to install streamlit on my conda environment. conda install -c conda-forge streamlit.
Read more >Fix Streamlit App Won't Import Problem In 1 Min #Python #App
If you can't import Streamlit 1.1.0, you may try 0.63.0.I'm using Python 3.9.7 on Windows 10 with Sublime Text 4.
Read more >Streamlit Not Import Issue | 2021 December - YouTube
I'm replicating the streamlit installation to show the error I got when pip install streamlit == 1.2.0 My OS is 64-bit Win10, and...
Read more >Streamlit cannot import sklearn module - python
You need to make sure that the module is installed on the correct environment. Are you using the native Python interpreter or through...
Read more >streamlit-webrtc
import streamlit as st from streamlit_webrtc import webrtc_streamer ... Variables inside the callbacks cannot be directly referred to from the outside.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub 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
Hi @lvyw1219,
did you use
streamlit run app
? The correct start should bestreamlit run app.py