-
Notifications
You must be signed in to change notification settings - Fork 1.4k
To Owner - Is the uc_driver provided compatible with arm 64 architecture? #2016
-
Hi,
I stumbled across this great library day before yesterday, and it has been solving issues that I faced in other automation libraries. The problem I am facing now is when I tried deploying it on my ubuntu server, it is giving me an error -
OSError: [Errno 8] Exec format error: '/home/ubuntu/SeleniumBase/SeleniumBase/seleniumbase/drivers/uc_driver'
I have checked the web and I am not sure where the problem lies. It has all the file permissions. So I just wanted to ask you if the uc_driver that comes with the library compatible with the arm 64 architecture? If not, is there any workaround?
Thank You.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 3 comments 7 replies
-
Hello, SeleniumBase is compatible with ARM 64 architecture. Verified on my M2 Mac, and also on GitHub Actions running UC Mode on Ubuntu systems. See: https://github.com/mdmintz/undetected-testing/actions/runs/5932953380
Your error looks to be caused by missing #!/bin/sh
in at least one of your shell scripts. See https://stackoverflow.com/a/27608363/7058266 for details.
Beta Was this translation helpful? Give feedback.
All reactions
-
Hello Michael,
I came across the smiliar issue with aarch64 Linux, though it worked find on all my Apple Silicon Macs. The the seleniumbase project was fully developed on an M1 Pro Mac
uname -a
Linux usarm 6.1.0-35-arm64 #1 SMP Debian 6.1.137-1 (2025年05月07日) aarch64 GNU/Linux
uname -r
6.1.0-35-arm64
sbase get chromedriver latest
file /root/miniconda3/envs/amazon/lib/python3.9/site-packages/seleniumbase/drivers/chromedriver
/root/miniconda3/envs/amazon/lib/python3.9/site-packages/seleniumbase/drivers/chromedriver: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=42432337a91f9dc908c4ae8e6cf7daa31f730bee, stripped
and of course running /path/to/chromedriver returned chromedriver: cannot execute binary file: Exec format error
I am running with the latest seleniumbase on Debian 12. Any clue why this it? thank you in advance!
Beta Was this translation helpful? Give feedback.
All reactions
-
Seems because googlechromelabs does not have official support for Linux Arm64.
Beta Was this translation helpful? Give feedback.
All reactions
-
You’ll probably want Ubuntu (not Debian) if using Linux.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
Beta Was this translation helpful? Give feedback.
All reactions
-
Alright my workaround is to install snap install chromium
and then apt install chromium-chromedriver
and copy chromedriver to the environment directory. cp /usr/lib/chromium-browser/chromedriver /root/miniconda3/envs/test/lib/python3.9/site-packages/seleniumbase/drivers/
Beta Was this translation helpful? Give feedback.
All reactions
-
I would observe the GitHub Actions examples on Ubuntu for proper use: https://github.com/mdmintz/undetected-testing/actions/runs/15655938351/job/44107012860
Also, chromedriver isn’t meant to be called directly. It should be used via SeleniumBase scripts.
Beta Was this translation helpful? Give feedback.
All reactions
-
I also ran into these same compatibility issues today with the ARM64 architecture, and I think I found the root cause. I am running things locally on an M3 Mac, but I'm also building a Docker container with the linux/arm64 architecture. When I run things locally on my Mac, everything works swimmingly. But once I build my container (using docker buildx build --provenance false --platform linux/arm64 -t mycontainer .
) and then try and run things from there, I got the following exception:
selenium.common.exceptions.NoSuchDriverException: Message: Unable to obtain driver for chrome; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location
But my Dockerfile already includes the following:
RUN apt-get update && apt-get install -y chromium chromium-driver
RUN sbase get chromedriver stable
So I know the chrome driver is there! Looking at the full traceback of the exception above revealed that the error was coming from line 5826 of browser_launcher.py in SeleniumBase (at time of this writing). That's the line where it tries to instantiate a webdriver.Chrome
object. Looking over that code, here's a minimal complete reproducible example of what SeleniumBase is trying to do:
from selenium import webdriver
from selenium.webdriver.chrome.service import Service as ChromeService
import os
service = ChromeService(log_output=os.devnull, service_args=["--disable-build-check"])
chrome_options = webdriver.ChromeOptions()
driver = webdriver.Chrome(service=service, options=chrome_options)
And if I run that code directly in a Python REPL inside my Docker container, indeed it gives the same NoSuchDriverException. However, if I specify the locations of both chromium and the chrome driver explicitly (along with 2 other random arguments), then it loads without raising any exceptions. So here is a working MCRE:
from selenium import webdriver
from selenium.webdriver.chrome.service import Service as ChromeService
import os
service = ChromeService(
executable_path="/usr/bin/chromedriver",
log_output=os.devnull,
service_args=["--disable-build-check"],
)
chrome_options = webdriver.ChromeOptions()
chrome_options.binary_location = "/usr/bin/chromium"
chrome_options.add_argument("--headless=new")
chrome_options.add_argument("--no-sandbox")
driver = webdriver.Chrome(service=service, options=chrome_options)
Notably, this worked (in the sense that it no longer throws any exceptions) when I set executable_path
to /usr/bin/chromedriver
, but it did not work when I tried setting it to .venv//lib/python3.13/site-packages/seleniumbase/drivers/chromedriver
. When I tried using the latter, it raised a different exception:
selenium.common.exceptions.WebDriverException: Message: Service .venv/lib/python3.13/site-packages/seleniumbase/drivers/chromedriver unexpectedly exited. Status code was: -5
So hopefully this helps shed some light on the issue. Perhaps there's some SeleniumBase configuration option I don't know about, which could be used to override these values? Or perhaps some of this could be patched in a future release? In the meantime, I think I'll try some monkey-patching of SeleniumBase in my code to see if I can't get this to work inside the Docker container...
Beta Was this translation helpful? Give feedback.
All reactions
-
Customizing the driver folder in SeleniumBase is done like this: #3859 (comment)
from seleniumbase.core import browser_launcher browser_launcher.override_driver_dir("./temp")
(Make sure the folder you pick already exists.)
Customizing the Chrome location is done using the binary_location
arg.
Eg: with SB(binary_location=CHROME_PATH) as sb:
On Linux, you'll need either google-chrome
or google-chrome-stable
(at least for UC Mode, which I can't tell if you're using or not because you didn't show the SeleniumBase code used to launch your web browser).
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
That works! Since you asked, here's an updated example of how I'm using SeleniumBase in this example. Adding in that browser_launcher command seems to have fixed things.
from seleniumbase import SB
from seleniumbase.core import browser_launcher
chrome_args = [
"--allow-insecure-localhost",
"--allow-running-insecure-content",
"--disable-dev-shm-usage",
"--disable-translate",
"--ignore-certificate-errors-spki-list",
"--ignore-ssl-errors",
"--remote-debugging-port=9222",
"--headless=new",
"--disable-gpu",
]
browser_launcher.override_driver_dir("/usr/bin")
with SB(uc=True, headless=True, chromium_arg=",".join(chrome_args), binary_location="/usr/bin/chromium") as sb:
sb.get("https://example.com/")
html = sb.get_page_source()
I'm able to run that in my linux/arm64 Docker container without issue. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1