close

[Solved] Selenium on MAC, Message: ‘chromedriver’ executable may have wrong permissions

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Selenium on MAC, Message: ‘chromedriver’ executable may have wrong permissions in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Selenium on MAC, Message: ‘chromedriver’ executable may have wrong permissions Error Occurs?

Today I get the following error Selenium on MAC, Message: ‘chromedriver’ executable may have wrong permissions in python.

How To Solve Selenium on MAC, Message: ‘chromedriver’ executable may have wrong permissions Error ?

  1. How To Solve Selenium on MAC, Message: 'chromedriver' executable may have wrong permissions Error ?

    To Solve Selenium on MAC, Message: 'chromedriver' executable may have wrong permissions Error Most answers here and in other related posts suggest users to just move the file to /usr/bin and they work fine if you are just running chromedriver locally and normally.

  2. Selenium on MAC, Message: 'chromedriver' executable may have wrong permissions

    To Solve Selenium on MAC, Message: 'chromedriver' executable may have wrong permissions Error Most answers here and in other related posts suggest users to just move the file to /usr/bin and they work fine if you are just running chromedriver locally and normally.

Solution 1

Most answers here and in other related posts suggest users to just move the file to /usr/bin and they work fine if you are just running chromedriver locally and normally.

However, if you are compiling Python scripts into executables using compilers such as cx_freeze, you may not be able to afford the luxury if your program always uses a relative link to chromedriver.

As the error message suggests, your compiled program does not have the permissions to manipulate chromedriver. To use a relative link to chromedriver on a Mac in your compiled Python program, you can programmatically change the permission of chromedriver in your Python script using:

import os
os.chmod('/path/to/chromedriver', 0755) # e.g. os.chmod('/Users/user/Documents/my_project/chromedriver', 0755)

You can test this by doing the following:

  1. cd to your working directory
  2. $ chmod 755 chromedriver to allow your program to manipulate it

P.S. 755 is the default numerical permission for files in usr/bin664 is the default numerical permission for files in other normal folders (probably your working directory). Thus, when chromedriver complains it does not have the correct permission, you need to grant it a numerical permission equivalent to or greater than 755.

Solution 2

If you are on windows give path including file name. For example, ‘./chromedriver/chromedriver.exe’ My line of code looks like below.

service = webdriver.chrome.service.Service(‘./chromedriver/chromedriver.exe’)

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read