How to allow executing Geckodriver and Chromedriver in Big Sur

Big Sur notification window for unsigned executables

In Big Sur macOS, Apple no longer allows executing binary files downloaded from the Internet without the correct signature. This leads to the following error in theselenium package:

selenium.common.exceptions.WebDriverException: Message: Service geckodriver unexpectedly exited. Status code was: -9

To make everything work as before. Run the following line in the terminal:

xattr -r -d com.apple.quarantine /path/to/geckodriver

Don’t forget to add a symbolic link to the downloaded binary file:

ln -s /path/to/geckodriver /usr/local/bin/geckodriver

The same procedure works for Chromedriver

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store