I am trying to use Selenium in a Streamlit Cloud app using the chrome webdriver. Repo here.
My .streamlit/packages.txt (and also tried in repo root) contains:
chromium
chromium-driver
The app logs show chromium installs correctly, but chromium-driver is not present (no /usr/lib/chromium/chromedriver), and chromedriver cannot be found in any usual location. This prevents Selenium from launching Chrome/Chromium headlessly.
I also tried adding chromium-chromedriver, but the log says “Unable to locate package chromium-chromedriver.”
Is there a new security restriction, or is this a bug in the recent build system?
Full logs:
[19:30:02] 📦 Apt dependencies were installed from /mount/src/copsextractor/packages.txt using apt-get.
…
E: Unable to locate package chromium-chromedriver
[19:30:07] installer returned a non-zero exit code
[19:30:07] Error during processing dependencies!
I just tested an app and didn’t have any problems installing chromium. Have you rebooted the app? Deleted it and redeployed it? If you remove the pins on your other dependencies, is there any difference? Community Cloud is using Debian Linux Bullseye, so that might be forcing some things to be older versions than in your development environment.
I couldn’t get chromium-driver to work, but I found a workaround by loading the python package webdriver_manager and using that to get the chrome webdriver. This python package went in requirements.txt instead of packages.txt.
Thank you for your help, hoping this response helps someone else down the line!
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.