Skip to content

OSError: [Errno 86] Bad CPU type in executable - downloading uc_driver on MacOS #2558

@Dylgod

Description

@Dylgod

Device: Mac Mini
MacOS: Sonoma 14.3.1 (23D60)
Chrome: Version 122.0.6261.94 (Official Build) (arm64)

When running this code:

from seleniumbase import Driver
from selenium.webdriver.common.by import By

web = Driver(browser='chrome', uc=True)

web.get("https://www.youtube.com")
web.sleep(5)
print(web.find_element(By.XPATH, '/html/body').text)
web.quit()

I get back

Warning: uc_driver update needed. Getting it now:

*** chromedriver to download = 122.0.6261.94 (Latest Stable) 

Downloading chromedriver-mac-x64.zip from:
https://storage.googleapis.com/chrome-for-testing-public/122.0.6261.94/mac-x64/chromedriver-mac-x64.zip ...
Download Complete!

Extracting ['chromedriver'] from chromedriver-mac-x64.zip ...
Unzip Complete!

The file [uc_driver] was saved to:
/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/seleniumbase/drivers/uc_driver

Making [uc_driver 122.0.6261.94] executable ...
[uc_driver 122.0.6261.94] is now ready for use!

Traceback (most recent call last):
  File "/Users/shy/PycharmProjects/pythonProject/shy_drivers/mac_shytest.py", line 4, in <module>
    web = Driver(browser='chrome', uc=True)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/seleniumbase/plugins/driver_manager.py", line 488, in Driver
    driver = browser_launcher.get_driver(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/seleniumbase/core/browser_launcher.py", line 1612, in get_driver
    return get_local_driver(
           ^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/seleniumbase/core/browser_launcher.py", line 3510, in get_local_driver
    driver = undetected.Chrome(
             ^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/seleniumbase/undetected/__init__.py", line 312, in __init__
    super().__init__(options=options, service=service_)
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/selenium/webdriver/chrome/webdriver.py", line 45, in __init__
    super().__init__(
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/selenium/webdriver/chromium/webdriver.py", line 50, in __init__
    self.service.start()
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/selenium/webdriver/common/service.py", line 98, in start
    self._start_process(self._path)
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/selenium/webdriver/common/service.py", line 208, in _start_process
    self.process = subprocess.Popen(
                   ^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 1953, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 86] Bad CPU type in executable: '/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/seleniumbase/drivers/uc_driver'

I am new to to Mac so it is possible i have done something wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    UC Mode / CDP ModeUndetected Chromedriver Mode / CDP Modeworkaround existsYou can reach your destination if you do this...

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions