richardyc / Chrome-GPT

An AutoGPT agent that controls Chrome on your desktop
GNU General Public License v3.0
1.68k stars 207 forks source link

FileNotFoundError: [Errno 2] No such file or directory: 'chromedriver' #24

Open kmb25 opened 1 year ago

kmb25 commented 1 year ago

Any chance you know where I'm going wrong here. Thanks!

youngfreeFJS commented 1 year ago

@kmb25 it is Selenium problem. What platform is your code running on? Linux, macOS, Windows or other platform? You can take a look at this link first: https://stackoverflow.com/questions/64919950/filenotfounderror-errno-2-no-such-file-or-directory-users-fuadhafiz-docume

faddy19 commented 1 year ago

You need to put your chromedriver to the same directory or the one where it should be. Download chromedriver first on google and place it somewhere. Copy the Path and paste it to your code. This should solve it

TakaWakiyama commented 1 year ago

The reason for the error may be a mismatch between the version of ChromeDriver you are using and the version of Google Chrome installed on your system. The specific error message you received is: "selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 77."

Thin can be help you.

  1. install webdriver-manager poetry add webdriver-manager

  2. mofify chromegpt/tools/selenium.py to auto resolve driver versions.

    
    from webdriver_manager.chrome import ChromeDriverManager  # <- add

def init(self, headless: bool = False) -> None:


- self.driver = webdriver.Chrome(options=chrome_options)
+ self.driver = webdriver.Chrome(ChromeDriverManager().install(), options=chrome_options)

```