On 20/01/2024 21:26, James via Cygwin wrote:
Latest version of Cygwin installed and updated.
I'm trying to run this python script which uses chromium in order to execute.
I got it all installed, and I'm just now trying to run the script and login,
but it keeps saying it cannot find the chromedriver.exe.
But the file exists and I know it's looking in the right place because I pasted
the linux version in the same spot and renamed it to chromedriver.exe and it
gave me an error about running a 16 bit program. I also dropped in the latest
version from the google archive for chromedriver.exe and when I ran the script,
it said the new version was not compatible with my current version, so I know
for a fact it is reading the file.
So why is it telling me it doesn't exist?
But, this works:
$ pip show selenium
Name: selenium
Version: 4.16.0
Summary:
Home-page: https://www.selenium.dev
Author:
Author-email:
License: Apache 2.0
Location: /home/User/Teachable-Dl/env/lib/python3.9/site-packages
Requires: certifi, trio, trio-websocket, urllib3
Required-by: seleniumbase
In any case, here is the error I get when I try to run the script:
User@User-PC ~/Teachable-Dl
$ python3 main.py --url https://courseurl.com/courses/enrolled/869509
--man_login_url https://sso.teachable.com/secure/1096/identity/login/password
--verbose
Traceback (most recent call last):
File
"/home/User/Teachable-Dl/env/lib/python3.9/site-packages/seleniumbase/core/browser_launcher.py",
line 2963, in get_local_driver
...
FileNotFoundError: [Errno 2] No such file or directory:
'C:\\Users\\User\\.cache\\selenium\\chromedriver\\win64\\109.0.5414.74\\chromedriver.exe'
(env)
have you tried replacing with a POSIX path ?
https://cygwin.com/cygwin-ug-net/using.html#using-pathnames
To have it use cygpath
$ cygpath -u
"C:\\Users\\User\\.cache\\selenium\\chromedriver\\win64\\109.0.5414.74\\chromedriver.exe"
/cygdrive/c/Users/User/.cache/selenium/chromedriver/win64/109.0.5414.74/chromedriver.exe
Now if I directly run that path:
cygstart
"C:\\Users\\User\\.cache\\selenium\\chromedriver\\win64\\109.0.5414.74\\chromedriver.exe"
It runs same as clicking on it, so the file exists and the path is right. The popup window is a
command window which starts with "Starting ChromeDriver 109...." and the last line is
"ChromeDriver was started successfully"
But the same file is saying doesn't exist when I try to run the script.
I also pasted the chromedriver.exe file into /env/bin/ folder in the working
directory, but it still says doesn't exist, yet now it says the file at the new
correct path doesn't exist, so in other words it detected and found it at the
new location but still is saying it didn't exist but it does.
Also, if I delete the folder at that path and then run the script again, it
still fails but it also creates the directory at that path and puts the
chromedriver.exe in the directory - that means it literally put the file there
itself but it's saying that it isn't found.
The Cygwin DLL and some programs like cygstart can handle the Windows
PATH style, but most of the applications don't, so use POSIX
Regards
Marco
--
Problem reports: https://cygwin.com/problems.html
FAQ: https://cygwin.com/faq/
Documentation: https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple