question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

can't import streamlit

See original GitHub issue

Summary

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:

  1. Go to ‘…’
  2. Click on ‘…’
  3. 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:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
aleksandar-anastasovcommented, Aug 29, 2021

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

2reactions
MattMacscommented, Apr 3, 2020

Hi @lvyw1219,

did you use streamlit run app ? The correct start should be streamlit run app.py

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found