whitphx / streamlit-webrtc

Real-time video and audio processing on Streamlit
https://discuss.streamlit.io/t/new-component-streamlit-webrtc-a-new-way-to-deal-with-real-time-media-streams/8669
MIT License
1.36k stars 182 forks source link

ImportError: cannot import name 'SessionInfo' from 'streamlit.web.server.server' #1024

Closed AmmarAhmedAlvi closed 2 years ago

AmmarAhmedAlvi commented 2 years ago

I am using ngrok to connect to virtual server environment and run into this error

This import error occurs since the last update. And I am able to solve it by downgrading streamlit to 1.11.0

Complete log:

File "/usr/local/lib/python3.7/dist-packages/streamlit/runtime/scriptrunner/script_runner.py", line 556, in _run_script exec(code, module.dict) File "/content/streamlit_app.py", line 2, in from streamlit_webrtc import webrtc_streamer File "/usr/local/lib/python3.7/dist-packages/streamlit_webrtc/init.py", line 10, in from .component import ( File "/usr/local/lib/python3.7/dist-packages/streamlit_webrtc/component.py", line 47, in from .session_info import get_script_run_count, get_this_session_info File "/usr/local/lib/python3.7/dist-packages/streamlit_webrtc/session_info.py", line 4, in from streamlit.web.server.server import SessionInfo

whitphx commented 2 years ago

Thank you for the report.

It seems that this problem has occurred since streamlit==1.12.1

I will fix it.


Technical note:

The change has been introduced in this PR: https://github.com/streamlit/streamlit/pull/5136/files#diff-3f73cf34a1595773b3b79ea85c5efd0c208e23beec4f812fa05419f87cff597e

AmmarAhmedAlvi commented 2 years ago

Thank you for the quick fix whitphx 👍

whitphx commented 2 years ago

It should be fixed with streamlit-webrtc==0.43.1, thanks!