SergeyPirogov / webdriver_manager

Apache License 2.0
2.05k stars 457 forks source link

OSError: [Errno 8] Exec format error #675

Open matabarestestiando opened 2 months ago

matabarestestiando commented 2 months ago

On Apple M2 I'm getting this error:

Traceback (most recent call last): File "/Users/myuser/PycharmProjects/pythonProject3/main.py", line 117, in automation() File "/Users/myuser/PycharmProjects/pythonProject3/main.py", line 53, in automation browser = webdriver.Chrome(service=ChromeService(ChromeDriverManager().install()), options=chrome_options) File "/Users/myuser/PycharmProjects/pythonProject3/venv/lib/python3.10/site-packages/selenium/webdriver/chrome/webdriver.py", line 45, in init super().init( File "/Users/myuser/PycharmProjects/pythonProject3/venv/lib/python3.10/site-packages/selenium/webdriver/chromium/webdriver.py", line 55, in init self.service.start() File "/Users/myuser/PycharmProjects/pythonProject3/venv/lib/python3.10/site-packages/selenium/webdriver/common/service.py", line 98, in start self._start_process(self._path) File "/Users/myuser/PycharmProjects/pythonProject3/venv/lib/python3.10/site-packages/selenium/webdriver/common/service.py", line 208, in _start_process self.process = subprocess.Popen( File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 971, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 1863, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) OSError: [Errno 8] Exec format error: '/Users/myuser/.wdm/drivers/chromedriver/mac64/127.0.6533.88/chromedriver-mac-arm64/THIRD_PARTY_NOTICES.chromedriver'

CalebePrates commented 2 months ago
chrome_path = ChromeDriverManager().install()
if "THIRD_PARTY_NOTICES.chromedriver" in chrome_path:
    chrome_path = chrome_path.replace("THIRD_PARTY_NOTICES.chromedriver", "chromedriver")
Emishne commented 2 months ago
  1. Make sure you're using the latest version
  2. in .wdm/drivers.json, remove the versions with HIRD_PARTY_NOTICES.chromedriver
  3. run again
matabarestestiando commented 2 months ago

It works just upgrading webdriver-manager==4.0.2

Thanks @Emishne