python streamlit run issue

Question:

I’m trying to run streamlit application(python 3.7.3) after installing it shows that error

    streamlit hello
  File "<ipython-input-2-c7a1b683aa76>", line 1
    streamlit hello
                  ^
SyntaxError: invalid syntax
Asked By: buddhi kavindra

||

Answers:

A bit late, but here is the recommended setup for using on Windows: https://github.com/streamlit/streamlit/wiki/Installing-in-a-virtual-environment

Answered By: user62241

Copy streamlit files in C:UsersAppDataRoamingPythonPython36Scripts and paste them into your C:ProgramDataAnaconda3Scripts and run your streamlit code in anaconda prompt.

Command to run:

streamlit run filename.py
Answered By: Tarun Reddy

In windows

py -m streamlit run hello.py
Answered By: Azaria Gebremichael

Actually it looks like you have misunderstood in where you have to use streamlit hello. This command will bring you to the welcome page of streamlit if you have successfully installed streamlit. I assume that you are a beginner. This streamlit hello should be entered in command prompt, But not in the Ipython Kernel. But you have entered this command into the Ipython Kernel. Look at this to learn how to use streamlit hello and how to run a python script with streamlit.

To visit welcome page

$ streamlit hello

To run python script via streamlit

$ streamlit run script.py
Answered By: Kavindu Ravishka

I solved it by using the below command

  1. streamlit run filename.py
Answered By: Ankit Kumar

You can try this one:

streamlit run hello.py
python -m streamlit run <filename.py>

This will work definitely.

Answered By: Manas Jadhav
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.