1

I'm working on a website automation program for 1 month, all went well and worked perfectly fine until I had to reset my laptop to factory settings due to a black screen that kept on going after turning on the laptop.

I'm running a laptop with windows 10, Pycharm is the IDE and I code with Python (64-bit version). I use chromedrivers, sadly there's not a 64-bit version but no problem was ever given by that.

Now, when I try to start the code I saved from the finished project, it just keeps saying

"'chromedriver.exe' executable needs to be in PATH."

I looked for everything I could, I copied the chromedriver into the PyCharm folder, I unzipped it on my Desktop, I used the executable_path=r'...' option, I tried to install the webdriver manager... nothing helped and the webdriver manager couldn't even get downloaded.

I think it's important to say that I have 2 mass storages, one called "Windows (C:)" and the other "Data (D:)", which has 380 GB of space, so I installed Pycharm and Python into Data(D:).

I'd really appreciate it if anyone could help me with this problem, it just makes me crazy how I tried everything fixing this.. seems like no one had ever had such a dumb problem.

Anyways, have a great day dear StackOverflow Community!

This is the error code:

C:\Users\User\PycharmProjects\Ersters\venv\Scripts\python.exe C:/Users/User/PycharmProjects/Ersters/Ersters.py
Automatic generator started, please wait.
Traceback (most recent call last):
  File "C:\Users\User\PycharmProjects\Ersters\venv\lib\site-packages\selenium\webdriver\common\service.py", line 72, in start
    self.process = subprocess.Popen(cmd, env=self.env,
  File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 1307, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the management file

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:/Users/User/PycharmProjects/Ersters/Ersters.py", line 15, in <module>
    driver = webdriver.Chrome(options=options, executable_path=r'C:\Users\User\Desktop\Python\chromedriver.exe')
  File "C:\Users\User\PycharmProjects\Ersters\venv\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in __init__
    self.service.start()
  File "C:\Users\User\PycharmProjects\Ersters\venv\lib\site-packages\selenium\webdriver\common\service.py", line 81, in start
    raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: 'chromedriver.exe' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home


Process finished with exit code 1
Norayr Sargsyan
  • 1,737
  • 1
  • 12
  • 26
  • Did you actually [add the folder of chromedriver.exe to your PATH](https://www.howtogeek.com/118594/how-to-edit-your-system-path-for-easy-command-line-access/)? Also try restarting your computer after you modified the PATH variable because it doesn't automatically propagate to running processes. – CherryDT Jul 31 '20 at 11:56
  • hmm sadly this method didn't work either – Razorbackfire Jul 31 '20 at 19:49
  • 1
    Did you make sure to add the _folder_, and _not_ the full path including `chromedriver.exe`? Did you restart? – CherryDT Jul 31 '20 at 20:06
  • What do you mean exactly ? I first used the own path setting, which just gave me another error code, something like „you need higher permissions to be able to use this path“, although I am the admin and I gave Pycharm and Chromedriver administrator rights – Razorbackfire Aug 01 '20 at 14:08
  • 1
    Sorry I don't understand what you mean. Did you look at the link how to modify your Windows PATH variable? – CherryDT Aug 01 '20 at 15:44
  • Yes I specified the PATH and just gave it the name "chromedriver", I think it found the chromedriver because I also checked it with the console which immediately found the driver, but pycharm somehow didn't have enough rights to be able to access the driver – Razorbackfire Aug 01 '20 at 20:14
  • @CherryDT Omg dude I made SUCH a dumb mistake... I just forgot also changing the right path of the driver in other lines.. I can't believe I actually had to try it for around 1 hour all in all. Thank you though, I learned something new and now I know how to add personal paths ;) – Razorbackfire Aug 02 '20 at 22:15

0 Answers0