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

Add mouse doesn't work for windows anymore (lack of Chrome binary) #82

Closed
yiran25 opened this issue Apr 4, 2022 · 4 comments
Closed

Comments

@yiran25
Copy link
Member

yiran25 commented Apr 4, 2022

Can't add mouse from windows git bash terminal anymore. Error appears to be that it can't find Chrome binary.

Traceback (most recent call last):
  File "C:\Users\VisStim-2p\anaconda3\envs\flexiznam_env\Scripts\flexiznam-script.py", line 33, in <module>
    sys.exit(load_entry_point('flexiznam', 'console_scripts', 'flexiznam')())
  File "C:\Users\VisStim-2p\anaconda3\envs\flexiznam_env\lib\site-packages\click\core.py", line 1137, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\VisStim-2p\anaconda3\envs\flexiznam_env\lib\site-packages\click\core.py", line 1062, in main
    rv = self.invoke(ctx)
  File "C:\Users\VisStim-2p\anaconda3\envs\flexiznam_env\lib\site-packages\click\core.py", line 1668, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Users\VisStim-2p\anaconda3\envs\flexiznam_env\lib\site-packages\click\core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\VisStim-2p\anaconda3\envs\flexiznam_env\lib\site-packages\click\core.py", line 763, in invoke
    return __callback(*args, **kwargs)
  File "d:\code\flexiznam\flexiznam\cli.py", line 24, in add_mouse
    main.add_mouse(mouse_name, project_id, mcms_animal_name, flexilims_username, mcms_username)
  File "d:\code\flexiznam\flexiznam\main.py", line 78, in add_mouse
    mouse_info = mcms.get_mouse_df(mouse_name=mcms_animal_name, username=mcms_username)
  File "d:\code\flexiznam\flexiznam\mcms\main.py", line 62, in get_mouse_df
    ret = download_mouse_info(mouse_name, username, password, suffix='get_mouse_df_file')
  File "d:\code\flexiznam\flexiznam\mcms\main.py", line 19, in download_mouse_info
    web = Browser()
  File "C:\Users\VisStim-2p\anaconda3\envs\flexiznam_env\lib\site-packages\webbot\webbot.py", line 68, in __init__
    self.driver = webdriver.Chrome(executable_path=driverpath, options=options)
  File "C:\Users\VisStim-2p\anaconda3\envs\flexiznam_env\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 76, in __init__
    RemoteWebDriver.__init__(
  File "C:\Users\VisStim-2p\anaconda3\envs\flexiznam_env\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "C:\Users\VisStim-2p\anaconda3\envs\flexiznam_env\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "C:\Users\VisStim-2p\anaconda3\envs\flexiznam_env\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "C:\Users\VisStim-2p\anaconda3\envs\flexiznam_env\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary
  (Driver info: chromedriver=2.39.562718 (9a2698cba08cf5a471a29d30c8b3e12becabb0e9),platform=Windows NT 10.0.19042 x86_64)
@ablot
Copy link
Member

ablot commented Apr 4, 2022

It still works on my mac. This error can come from a non-default installation of chrome. Can you try to uninstall/re-install chrome, making sure it is a system wide install in the default path?

@ablot
Copy link
Member

ablot commented Oct 12, 2022

There might be an annoying issue with webbot shipping its own driver and not updating them (see nateshmbhat/webbot#87).

The solution should be to download the correct driver from:
https://chromedriver.chromium.org/downloads

Replace the original webbot drive:
Find the install folder in python:

import webbot
webbot.__file__

Then navigate to the drivers folder in the same directory as webbot.py and replace the driver file of your plateform (renaming to the same chrome_PLATEFORM)

You want to try @yiran25 ?

@yiran25
Copy link
Member Author

yiran25 commented Oct 12, 2022 via email

@ablot
Copy link
Member

ablot commented Dec 13, 2022

I've added a note on the main README.md file (the front page of this repository). I'll close this issue for now. You can re-open if it does not solve your problem

@ablot ablot closed this as completed Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants