MacOS Catalina(v 10.15.3): Error: “chromedriver” cannot be opened because the developer cannot be verified. Unable to launch the chrome browser
Asked Answered
U

16

311

I have recently upgraded my mac machine to OS Catalina(v 10.15.3). After this upgrade I am unable to launch the chrome driver using selenium.

I am facing the below error when I run the selenium code to launch the chrome browser.

"“chromedriver” cannot be opened because the developer cannot be verified". "macOS cannot verify that this app is free from malware."

Please help me!

Underhill answered 23/2, 2020 at 12:4 Comment(0)
U
549

I found the work around as below

  1. Open terminal
  2. Navigate to path where your chromedriver file is located
  3. Execute any one of the below commands

Command1: xattr -d com.apple.quarantine <name-of-executable>

Example

/usr/local/Caskroom/chromedriver 
$ xattr -d com.apple.quarantine chromedriver 

(or)

Command2: spctl --add --label 'Approved' <name-of-executable>

Source: https://docwhat.org/upgrading-to-catalina

Note: This will work only with the file(s) where the above command is executed. If a new chromedriver is downloaded then the command has to be executed again on the newly downloaded file

Underhill answered 24/2, 2020 at 11:26 Comment(11)
And most importantly this is the solution when you don't have admin access!Greenquist
xattr -d com.apple.quarantine <path-to-executable> does not require admin right spctl --add --label 'Approved' <path-to-executable> requires admin passwordPerigynous
so this worked for me but now my chromedriver crashes right after starting. Anybody else having this problem or is it just me?Formality
unfortunately neither of these fixes work on big sur..Unruly
spctl --add --label 'Approved' chromedriver, after this command i have allowed permission from System Preferences > Security & Privacy. this command worked for me Thank you.Philippines
On Big Sur- xattr -d com.apple.quarantine <path to chromedriver> ie xattr -d com.apple.quarantine /usr/local/bin/chromedriverTrivandrum
xattr -d com.apple.quarantine $(which chromedriver)Casino
Further to @tfantina's comment, you can get this generic with xattr -d com.apple.quarantine $(which chromedriver)Rabid
This solution works fine with MacOS Catalina. Just worked after executing the first command above.Microprint
This solution works on MacOS Ventura as wellKnute
Congratulations: you have successfully opened an application that could contain any kind of malware because it hasn't been notarized and signed correctly.Berber
L
220

In macOS Catalina and macOS Mojave, when an app fails to install because it hasn’t been notarized or is from an unidentified developer, it will appear in System Preferences > Security & Privacy, under the General tab. Click Open Anyway to confirm your intent to open or install the app.

enter image description here

The warning prompt reappears, and you can click Open.*

enter image description here

The app is now saved as an exception to your security settings, and you can open it in the future by double-clicking it, just as you can any authorized app.

*If you're prompted to open Finder: control-click the app in Finder, choose Open from the menu, and then click Open in the dialog that appears. Enter your admin name and password to open the app.

Lincoln answered 23/2, 2020 at 12:20 Comment(6)
Thanks for the answer. But the problem is I am unable to see 'Open Anyway' optionUnderhill
@VenkateshG - This looks permission issue to me, do you have admin rights on your machine ?Lincoln
it's not the same in Big SurBetteanne
Thanks, this solved my issue on Big Sur. I first ran the spctl --add --label 'Approved' chromedriver in /usr/local/Caskroom on terminal, then tried to run an app that started chromedriver, then went to the Settings place and gave chromedriver access.Unruly
Worked for me in Catalina. The "Open Anyway" button was waiting for me as described, then running the CLI command again I got a popup and was able to allow it.Fari
click the file in mac finder for the file to appear in Open Anyway section of Privacy and settings. Launching the file from terminal didnt add to privacy somehow. I am on bigsur.Ordonnance
A
106

Existing answers are great, and they work.

But an easier solution is to open the terminal and run this:

xattr -d com.apple.quarantine $(which chromedriver)
Adrell answered 23/9, 2020 at 1:26 Comment(7)
elegant, but did not work for me on Big Sur because No such xattr: com.apple.quarantine ..Unruly
That likely means you have >1 version of chromedriver installed, in which case you can run this instead xattr -d com.apple.quarantine path/to/chromedriverAdrell
If you installed chromedriver with homebrew, run brew info chromedriver to get its path, then run this (replacing the version with your version given in the previous step): xattr -d com.apple.quarantine /usr/local/Caskroom/chromedriver/89.0.4389.23/chromedriverAdrell
Thank you! worked great in MacOS Monterey 12.2.1Apparatus
Thanks worked for me on macOS Catalina 10.15.7 (19H1419)Jase
Thanks this solution worked for my macOS Monterey 12.5Udder
Thanks this solution worked for me on macOS Ventura 13.6Luisaluise
T
32

Quick solution

  1. Open Finder
  2. Navigate to where the chromedriver file is located
  3. Right-click on the chromedriver file and select open

After this the script should work fine.

Tedford answered 22/3, 2020 at 23:17 Comment(2)
This worked for me. Thanks! This technique gives you the option to "Open Anyway", right in the "can't open chromedriver" dialog, so it's pretty quick and easy.Maltreat
Did the work for me without changing any settings!Dragline
F
24

Two steps to solve this:

  1. Navigate to the path using command- cd /usr/local/bin . This is where you will see your chromedriver installed.
  2. When inside the bin directory, run this command- xattr -d com.apple.quarantine chromedriver .

And that's all. It worked for me like that.

Frication answered 21/12, 2020 at 22:50 Comment(0)
L
14

After updating to Mac OS Ventura 13.0 you are now required to go to System Settings > Privacy & Security. Scroll down to the Security section and you can see chromedriver there. Click on Allow Anyway (it will prompt for admin credentials).

enter image description here

Landgrave answered 9/11, 2022 at 0:5 Comment(0)
H
12

I've found that if you've tried this solution:

// Get the path to chromedriver, example: /usr/local/bin/chromedriver
which chromedriver 

// Change permissions
xattr -d com.apple.quarantine <path_to_chromedriver>

and your browser opens and then immediately closes, it could be from installing the wrong chromedriver version.

Look for your chrome version by launching chrome then selecting

Chrome > About Google Chrome

Remove your current chromedriver and search for the chromedriver that matches your chrome version displayed in your "About Google Chrome" (example: 96.0.4664.110). This worked for me on a mac with the Monterey OS

Hoppe answered 30/12, 2021 at 19:15 Comment(1)
Yes, this is exactly what I would suggest that if I weren't seeing it. This is the correct answer.Adamek
E
10

Open terminal and navigate to path where chromedriver is downloaded. Execute xattr -d com.apple.quarantine chromedriver

Eryn answered 28/3, 2020 at 16:0 Comment(0)
A
10

The easiest way to solve this error, please follow the steps below.

  1. Navigate to where your chrome driver application is saved / downloaded
  2. Right click and select Open with
  3. Select open with Terminal
  4. Allow or select yes
  5. you should get a success message on the terminal screen
  6. Go back to open your chrome driver or on your IDE and run, you should not get the error anymore
Adulterer answered 13/2, 2022 at 13:53 Comment(0)
H
9

What worked for me on macOS Catalina Version 10.15.6 (19G73) was

  1. Install chromedriver via Homebrew:

    brew install chromedriver

  2. Then, in Finder click on Go menu and the click Go to folder option, and enter this route:

    /usr/local/Caskroom/chromedriver/

  3. There you should see a folder with the chromedriver version you have installed, something like this:

    88.0.4324.96

  4. Enter the folder and you should see the chromedriver binary file.

  5. Right click on it, and click on Open

Now, you should get a terminal window popping up with the output:

Last login: Sun Jan 31 12:29:15 on ttys001
/usr/local/Caskroom/chromedriver/88.0.4324.96/chromedriver ; exit;
   ~  /usr/local/Caskroom/chromedriver/88.0.4324.96/chromedriver ; exit;
Starting ChromeDriver 88.0.4324.96 (68dba2d8a0b149a1d3afac56fa74648032bcf46b-refs/branch-heads/4324@{#1784}) on port 9515
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.

Finally, press Ctrl+C to stop the execution and quit the terminal window.

Now, you should be able to run capybara tests.

Heliotherapy answered 31/1, 2021 at 18:47 Comment(0)
M
5

It was a permission issue... After upgrading chrome this error was showing so I followed the below mentioned steps and it worked in my system.

  1. System Preferences
  2. Security & Privacy
  3. Go to General tab
  4. Allow apps downloaded from:
  5. Select App Store and identified developers
  6. Click the lock to make changes.
  7. Enter your system password
  8. Click Open Anyway to confirm your intent to open or install the app.
Midrib answered 13/9, 2021 at 6:47 Comment(1)
Very simple solution to allow permission!Hemotherapy
D
3

(What worked for me, hopefully works for you too)

Update for all the macOS Big Sur 11.0 users:

  1. use homebrew to install chromedriver

    brew install chromedriver

  2. navigate to chromedriver that is in the Caskroom folder specifically

    /usr/local/bin/Caskroom/chromedriver ... keep going until you see the Unix Executable File called "chromedriver"

  3. following Apple's recommendation for opening Mac apps from unidentified developer, double-click chromedriver, and then click "Open"

For me, this resulted in a terminal window popping up with the output:


Starting ChromeDriver ...
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.

I can now run scrapy-selenium no problem, you can close the terminal window (yes, terminate the process is OK) and it should still work without stopping you now.

Let me know if this works for you

Daryldaryle answered 17/1, 2021 at 0:9 Comment(1)
I was trying to get selenium with goolechrome + java/maven started so I used brew cask install of the chromedriver when I had this error. Doing this worked for me. If you need to navigate the FINDER app on Mac to specific folders , use SHIFT + COMMAND + GTrelliswork
F
2

The above answers were helpful. I would just add that if you're running Selenium from a development environment, in my case a Jupyter Notebook, and this is the issue, you're likely to see a PermissionError: [Errno 13] Permission denied error. There are other causes for this error, but it can be that macOS Catalina is blocking chromedriver from running for security reasons. Following the approaches above, I ran it from the command line and then was able to open it from Jupyter using driver = webdriver.Chrome('path/to/chromedriver).

Favin answered 24/6, 2020 at 14:7 Comment(0)
P
2

xattr -d com.apple.quarantine $(which chromedriver) alone is not enough.

with the lastest version of chromedriver, it seem like they are dividing into version folders.
for me on 9/30/20. what worked for me is xattr -d com.apple.quarantine 85.0.4183.87/chromedriver

Papistry answered 30/9, 2020 at 16:38 Comment(0)
C
2

Update on difficulty installing webdriver-manager on M1 Macs:

I'm running an ARM64 conda miniforge3 env, and wonder if webdriver_manager installation issues might be missing support/compatibility, as discussed about the Mozilla geckodriver here. Although it does seem like the drivers have already added support for M1, there appear to be yet unresolved issues (see here).

Regardless, it was easy to install ChromeDriver manually:

  1. Have a Chrome install --> Download the corresponding driver version (eg, 106) from ChromeDriver
  2. Add it to $PATH, ie, either paste the shell file into wherever $PATH is—eg, /usr/local/bin/—or via commandline:
echo $PATH 
export PATH=$PATH:/path/to/chrome-driver 

PS: You have to run the driver file once as administrator before you can start driving. If your Mac won't trust the driver file, Ctrl+Click and Open to do so.

Consalve answered 10/7, 2022 at 11:6 Comment(1)
Right if it opens when you click the executable then we need to add it to our path. Thanks.Tella
H
-3

1.Navigate to path where your chromedriver file is located 2.right click on the chromedriver 3.open with terminal 4.run ur code

Honewort answered 27/8, 2021 at 8:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.