[Tutor] Windows err code 2
Mats Wichmann
mats at wichmann.us
Tue Feb 4 14:59:56 EST 2020
On 2/4/20 2:07 PM, Colin Kimble wrote:
> Afternoon, my name is Colin Kimble. I have been having trouble with regards
> to running code. I have run it from the command prompt. I had received two
> error messages.
there's only one error, it's just it compounds.
> It cannot find my .py file and it says that Chromedriver needs to be
in the
> path, but I am not to sure how this is to be done. I hope you are able to
> assist me. I wish you well, and I hope to hear from you soon.
it's not having trouble finding your Python file, it's having trouble
finding a program it needs to run. [extra explanation: the subprocess
module is used by Python code to call an external command, and you can
see from the error the system can't find that command. Trimmed down a bit:
> "C:\Users\pc\AppData\Local\Programs\Python\Python38-32\lib\site-packages\
> selenium\webdriver\common\service.py", line 72, in start
> self.process = subprocess.Popen(cmd, env=self.env,
...
> FileNotFoundError: [WinError 2] The system cannot find the file specified
Unfortunately, there it's not telling you what the value of "cmd", the
command to run, is.
This should tell you what to do next:
> selenium.common.exceptions.WebDriverException: Message: 'chromedriver'
> executable needs to be in PATH. Please see
> https://sites.google.com/a/chromium.org/chromedriver/home
Probably a subsidiary page is what you want:
https://sites.google.com/a/chromium.org/chromedriver/getting-started
suggest you try the "Sample Test" listed there after you've followed the
installation instructions.
For anything further, you need to work with the Selenium community, I'd
imagine - this isn't a Python problem per se, looks like just getting
the setup of a bunch of dependencies right.
More information about the Tutor
mailing list