Hello,
In one of my repos i was using
from streamlit.report_thread import REPORT_CONTEXT_ATTR_NAME
But now iām getting an error.
ModuleNotFoundError: No module named 'streamlit.report_thread'
Did the syntax change? where can i see how to fix it or what do i need to change to? I donāt see any reference to it anywhere.
I also have the same error.
Does anyone know how to fix?
Thanks,
Itās crazy that thereās no solution to this in 2023.
streamlit:develop
ā streamlit:feature/report-refactor
opened 06:45PM - 07 Dec 21 UTC
Still needs some threading documentation (and maybe explicitly guard against use⦠r scripts violating threading requirements?), AppSession constructor cleanup, and a pile of misc report references in variable/parameter names and documentation.
Without digging into it deeply, it would seem āreportā became āscript_runā in general.
Right, @mathcatsand , but I still get error Cannot find reference 'ReportThread' in '__init__.py'
when trying to write from streamlit.ReportThread
. Thatās the main issue.
As noted in the linked pull request. āReportThreadā no longer exists. It was an internal API, subject to change without notice, and not supported.
streamlit:develop
ā streamlit:feature/report-refactor
Hi @richlysakowski - `streamlit.report_thread` was an internal API. We don't rec⦠ommend that devs use internal APIs, because they're subject to change without notice, and we don't provide support for them. (In this case, ReportThread no longer exists.)
If you're looking to create additional threads within your Streamlit app, you can do this with the built-in Python thread class, but note that it is _not safe_ to call streamlit APIs from other threads. (If you want to issue Streamlit commands from another thread, you could e.g. have that thread enqueue requests to a shared queue that your script's thread processes.)
I see. So how do we tackle the āmissing ReportContextā threading error?