Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS - Error with chromedriver? #18

Open
TravelTrader opened this issue Jun 27, 2018 · 8 comments
Open

macOS - Error with chromedriver? #18

TravelTrader opened this issue Jun 27, 2018 · 8 comments

Comments

@TravelTrader
Copy link

After starting with python chat.py Wonderfulname nothing happens than this message:

Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
 
	Chromedriver Error. Read the above error (if any), then
	Check if installed chromedriver version is compatible with installed Chrome version.

Does anyone have a hint for me?
Thank you. I have the newest Chrome version, the newest Chromedriver, ...!?

@tomasi-o
Copy link

  1. type chromedriver in the terminal of your choice. If nothing happens it is not defined in your PATH environment.
  2. type $PATH in your Terminal and look for chromedriver. Is it listed here? If not, make a new entry in PATH which links to the chromedriver executable, e. g. export PATH="/usr/local/PATH_TO_chromedriver/bin:$PATH"
    Further reading here

@TravelTrader
Copy link
Author

Thanks for the fast response.
I copied my chromedriver to /usr/local/bin/ and when I call it in the terminal, it shows

Starting ChromeDriver 2.40.565386 (45a059dc425e08165f9a10324bd1380cc13ca363) on port 9515
Only local connections are allowed.

But with python chat.py Wonderfulname it shows the same as above.

@TravelTrader
Copy link
Author

In chat.py I edited

'chromedriver_path': '/usr/local/bin/chromedriver',

for the config-variable. And at this location I can list the file by ls /usr/local/bin/ch* for example. But then after starting it shows

Message: unknown error: cannot find Chrome binary

What can I do for testing and trying, too?

@tomasi-o
Copy link

tomasi-o commented Jul 2, 2018

How did you install chromedriver? If you installed it via homebrew it creates only a hardlink to chromedriver in e. g. '/usr/local/bin/chromedriver'. You have to follow that hardlink (or alias in MacOS) to get the correct path to your chromedriver binary. For example, I have changed my chromedriver path to
'chromedriver_path': "/usr/local/Caskroom/chromedriver/2.37/chromedriver".format(os.environ['HOME']),.

maybe try locate chromedriver to find out where it is installed.

@TravelTrader
Copy link
Author

Okay, thanks for your help. I thought I know about those variables but I didn't get it running.

locate chromedriver leads to /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/chromedriver.rb and when I enter

'chromedriver_path': "{0}/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/chromedriver.rb".format(os.environ['HOME']),

after typing python3 chat.py Rolf there is the message:

Message: 'chromedriver.rb' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
 
	Chromedriver Error. Read the above error (if any), then
	Check if installed chromedriver version is compatible with installed Chrome version.

With these informations. Do you have another hint for me? Should I enter export PATH="/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/:$PATH" or which PATH should I fill in?

I think I didn't understand the homebrew stuff ... thanks a lot.

@TravelTrader
Copy link
Author

I tried to install it again by just the zip-file. Put it in the /usr/local/bin-directory. But chromedriver shows

Starting ChromeDriver 2.40.565386 (45a059dc425e08165f9a10324bd1380cc13ca363) on port 9515
Only local connections are allowed.

and nothing happens.

In the ls-list it's printed as

-rwxr-xr-x@ 1 company  staff    12M  7 Jun 13:25 /usr/local/bin/chromedriver

Maybe the someone knows what could be wrong because of the only local ... message? What about the chmod-stuff?

@tomasi-o
Copy link

tomasi-o commented Sep 17, 2018

@TravelTrader

locate chromedriver leads to /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/chromedriver.rb and when I enter

Your path leads to a homebrew formula (a ruby script containing a set of commands to install a certain software), not the chromedriver binary, which has no extension, just sth. like my example in the post above

'chromedriver_path': "{0}/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/chromedriver.rb".format(os.environ['HOME']),

it should be something similar as in my config, thus a /path/to/chromedriver (note the missing ".rb" extension).
'chromedriver_path': "/usr/local/Caskroom/chromedriver/2.37/chromedriver".format(os.environ['HOME']),

With these informations. Do you have another hint for me? Should I enter export PATH="/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/:$PATH" or which PATH should I fill in?

As I already said in a post above, locate your chromedriver binary with the terminal command locate chromedriver. the result should read something the like /path/to/chromedriver and not /path/to/chromedriver.rb.

I think I didn't understand the homebrew stuff ... thanks a lot.

That was the way I installed it, sorry for the irritiation. I hope you will be able to get it to run finally. Have phun!

@CanerEren
Copy link

hello, I have installed the chrome driver with homebrew. I still get this error

05657A-CEREN:whatsapp-web ceren$ python3 chat.py PsyanorA chat.py:59: DeprecationWarning: use options instead of chrome_options driver = webdriver.Chrome(config['chromedriver_path'], chrome_options=driver_options) Message: Can not connect to the Service /usr/local/Caskroom/chromedriver/2.46/chromedriver

Chromedriver Error. Read the above error (if any), then Check if installed chromedriver version is compatible with installed Chrome version.

I have also updated my PATH :

05657A-CEREN:whatsapp-web ceren$ echo $PATH /usr/local/Caskroom/chromedriver:/usr/local/mysql/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Library/Frameworks/Mono.framework/Versions/Current/Commands

what can i do at this point?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants