chromium-driver not installed on Streamlit Cloud—chromedriver missing for Selenium automation

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] :red_exclamation_mark: installer returned a non-zero exit code
[19:30:07] :red_exclamation_mark: Error during processing dependencies!

Thank you for any help!

packages.txt needs to be in the root of your repository, not in .streamlit. :slight_smile:

Thanks for the quick response - it’s in both places

Sorry for reading too fast.

This should work for a packages.txt file:

chromium
chromium-driver

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!

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.