Microsoft Windows [Version 10.0.19045.3570]
(c) Microsoft Corporation. All rights reserved.
C:\Users\User>E:
E:>mkdir chatbot_project
A subdirectory or file chatbot_project already exists.
E:>cd chatbot_projectstreamlit run streamlit_app.py
The system cannot find the path specified.
E:>cd chatbot_project
E:\chatbot_project>streamlit run streamlit_app.py
‘streamlit’ is not recognized as an internal or external command,
operable program or batch file.
E:\chatbot_project>.\venv\Scripts\activate
(venv) E:\chatbot_project>streamlit run streamlit_app.py
Welcome to Streamlit!
If you’d like to receive helpful onboarding emails, news, offers, promotions,
and the occasional swag, please enter your email address below. Otherwise,
leave this field blank.
Notepad code
import streamlit as st
st.set_option(‘server.port’, 8502)
def main():
st.title(“Chatbot UI”)
user_input = st.text_input(“Enter your message:”)
st.button(“Send”)
How can that possibly work? By the time st.set_option('server.port', 8502) is executed, the server has already started. And you would need to change the code to make it run in a different port.
Besides, the welcome message suggest me that your streamlit is quite old. In a recent version you would get this (IP redacted):
(venv) E:\chatbot_project>streamlit run streamlit_app.py
You can now view your Streamlit app in your browser.
Local URL: http://localhost:8501
Network URL: http://xxx.xxx.xxx.xxx:8501
2023-11-17 09:40:24.250 Uncaught app exception
Traceback (most recent call last):
File "E:\chatbot_project\venv\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 534, in _run_script
exec(code, module.__dict__)
File "E:\chatbot_project\streamlit_app.py", line 3, in <module>
st.set_option('server.port', 8502)
File "E:\chatbot_project\venv\Lib\site-packages\streamlit\runtime\metrics_util.py", line 396, in wrapped_func
result = non_optional_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\chatbot_project\venv\Lib\site-packages\streamlit\config.py", line 124, in set_user_option
raise StreamlitAPIException(
streamlit.errors.StreamlitAPIException: server.port cannot be set on the fly. Set as command line option, e.g. streamlit run script.py --server.port, or in config.toml instead.
can you please help me with this , i m also geeting same thing in terminal
PS C:\Users\Naveen\PycharmProjects\Email\sms-classifier> streamlit run app.py
Welcome to Streamlit!
If you’d like to receive helpful onboarding emails, news, offers, promotions,
and the occasional swag, please enter your email address below. Otherwise,
leave this field blank.
Email:
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.