There are examples everywhere using streamlit.ReportThread, however streamlit.ReportThread throws a module not found error on multiple machines. streamlit.report_thread does exist but none of the functions work if i use streamlit.report_thread. How do i fix this error? do i need a specific version of streamlit so that streamlit.ReportThread does exist and the examples work?
Thanks for the help!!
Here is an example that previously worked but no longer does because ReportThread is not found
import streamlit.ReportThread as ReportThread
To add a little more to this. streamlit version 0.63.0 works with
from streamlit import ReportThread
If ReportThread was changed to streamlit.report_thread after version 0.63.0 then why are all examples still showing from streamlit import ReportThread
Also, if i try to update from ReportThread to report_thread in later versions streamlit then it breaks code that used ReportThread.
Particularly this section for this specific problem:
try:
import streamlit.ReportThread as ReportThread
from streamlit.server.Server import Server
except Exception:
# Streamlit >= 0.65.0
import streamlit.report_thread as ReportThread
from streamlit.server.server import Server
But I also found this section useful and related:
s = session_info.session
if (
# Streamlit < 0.54.0
(hasattr(s, '_main_dg') and s._main_dg == ctx.main_dg)
or
# Streamlit >= 0.54.0
(not hasattr(s, '_main_dg') and s.enqueue == ctx.enqueue)
or
# Streamlit >= 0.65.2
(not hasattr(s, '_main_dg') and s._uploaded_file_mgr == ctx.uploaded_file_mgr)
):
this_session = s
Most of the examples were made before Streamlit’s code refactoring, prior version 0.65.
Some gist (and comments below them) provide patches for further Streamlit version. @Ben_Leathers’s reply should work in your case.
And really soon we’ll have an official verison for this I think
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.