I am new to streamlit and just trying to open a basic python script for the first time. I am using the anaconda command prompt and I have already installed streamlit.
Here is how I am running the program:
and here is the message I get when my web browser tries to open the file:
Seems that there is an HTML doctype tag on line 7 → <!DOCTYPE html>.
HTML tags are not valid Python syntax, and hense a SyntaxError is raised during code execution. Perhaps you copy pasted this code from somewhere? If you wish to execute raw HTML code you can use components.html.
import streamlit.components.v1 as components
components.html("<h1>HTML can be put herr</h1>")
Could you share your code? This way I can check if there is more invalid syntac.
Ahhh, you’re right… I was copying the code from somewhere incorrectly and so it was registering it as HTML instead of Python… thank you! Simple as hell mistake!
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.