I have multiple streamlit apps, that all have been working fine until today. I havenât changed anything about the code since last running them. Today, when I tried running one of them as I usually do (streamlit run file.py) I got the following error message:
ImportError: cannot import name âComponentRequestHandlerâ from âstreamlit.components.v1.componentsâ (C:\Anaconda3\lib\site-packages\streamlit\components\v1\components.py)
I tied with all my other streamlit apps and get the same error. I already tried updating streamlit but the error is still there.
I donât directly try to import this, which is why Iâm a bit confused. This error message just suddenly shows up for all my (different) streamlit apps, which have been working fine until today. I havenât changed the codes in the meantime.
The error message doesnât seem to refer to a line in my own code:
Traceback (most recent call last):
File âC:\Anaconda3\lib\runpy.pyâ, line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File âC:\Anaconda3\lib\runpy.pyâ, line 87, in run_code
exec(code, run_globals)
File "C:\Anaconda3\Scripts\streamlit.exe_main.py", line 4, in
File âC:\Anaconda3\lib\site-packages\streamlit\cli.pyâ, line 27, in
import streamlit.bootstrap as bootstrap
File âC:\Anaconda3\lib\site-packages\streamlit\bootstrap.pyâ, line 36, in
from streamlit.server.server import Server, server_address_is_unix_socket
File âC:\Anaconda3\lib\site-packages\streamlit\server\server.pyâ, line 65, in
from streamlit.components.v1.components import ComponentRequestHandler
ImportError: cannot import name âComponentRequestHandlerâ from âstreamlit.components.v1.componentsâ (C:\Anaconda3\lib\site-packages\streamlit\components\v1\components.py)
Which version of Streamlit is that? There is no lib\site-packages\streamlit\server\server.py in Streamlit 1.14.0. The las release with that file was 1.11.1, but that version does have a class ComponentRequestHandler in streamlit.components.v1.components. You might have a corrupted installation.
Unless the version of the Streamlit library is pinned in your dependency file, the system will install the latest version of the library when performing updates to the underlying infrastructure. Updates to the underlying infrastructure will happen on a regular basis (like was the case here).
To address the issue you should either update your application to use the latest Streamlit version or you should pin the version of the Streamlit library.
Just checked my version of Streamlit - it is indeed 1.11.1.
I updated it again just now and the version is still 1.11.1. Can you think of a reason why the most recent version I can have is 1.11.1?
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.