'Chromedriver not found starting Python script from shell

I'm trying to run multiple Python scripts using shell-scripting. As a trial I just wanted to see if one script would run. I am using Spyder-terminal to run my script. I run my script with the following code:

python C:\USERS\DAVID\DESKTOP\SELENIUM\SCRIPT1.PY

But I receive the following message:

C:\Users\David>python C:\USERS\DAVID\DESKTOP\SELENIUM\SCRIPT1.PY
Traceback (most recent call last):
  File "C:\Users\David\anaconda3\lib\site-packages\selenium\webdriver\common\service.py", line 71, in start
    self.process = subprocess.Popen(cmd, env=self.env,
  File "C:\Users\David\anaconda3\lib\subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\David\anaconda3\lib\subprocess.py", line 1311, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\USERS\DAVID\DESKTOP\SELENIUM\SCRIPT1.PY", line 10, in <module>
    driver=webdriver.Chrome(options=options)
  File "C:\Users\David\anaconda3\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 70, in __init__
    super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog",
  File "C:\Users\David\anaconda3\lib\site-packages\selenium\webdriver\chromium\webdriver.py", line 90, in __init__
    self.service.start()
  File "C:\Users\David\anaconda3\lib\site-packages\selenium\webdriver\common\service.py", line 81, in start
    raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://chromedriver.chromium.org/home

The chromedriver is located in the following path:

C:\Users\David\Desktop\Selenium\chromedriver.exe


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source