App.py not opening. please help

I used-
streamlit run app.py

It doesnt work so i used-
streamlit run

it opened but shows the following error-

File "C:\Users\aasth\AppData\Local\Temp\tmp27vclseo\app.py", line 1
  <!DOCTYPE HTML>
  ^
SyntaxError: invalid syntax

MY app.py file code-----
import pickle
import string
import streamlit as st
import webbrowser

global Lrdetect_Model

LrdetectFile= open(‘file.pkl’, ‘rb’)
Lrdetect_Model=pickle.load(LrdetectFile)
LrdetectFile.close()
st.title(“ffff”)
input_test=st.text_input(“jjjjj”,‘llll’)

button_clicked=st.button(“mnmnmn”)
if button_clicked:
st.text(Lrdetect_Model.predict([input_test]))

How about doing like this.

  1. Create a folder, say streamlit_project under drive c.

C:\streamlit_project

  1. Under streamlit_project add your app.py file.

C:\streamlit_project\app.py

  1. Open command prompt / powershell and go to the folder ‘streamlit_project’. Then run app.py with streamlit.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.