Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to obtain driver from chrome using Selenium Manager when onefile and standalone #2746

Closed
Diegocndd opened this issue Mar 5, 2024 · 12 comments
Assignees
Labels
Milestone

Comments

@Diegocndd
Copy link

Hello! I didn't use chromedriver in my project. With the new version of Selenium (4), it is no longer necessary to specify a chromedriver. However, this chromedriver management is not working.

My code is as simples as:

from selenium import webdriver

chrome_options = webdriver.ChromeOptions()
driver = webdriver.Chrome(options=chrome_options)
driver.get('https://www.google.com/')

The code runs on the system fine and when i don't use onefile.

Compiled it with: python -m nuitka --follow-imports --standalone --onefile --include-package=selenium main.py

When executing main.exe, I receive the following error:

Traceback (most recent call last):
File "C:\Users\diego\AppData\Local\Temp\OND5FF~1\selenium\webdriver\common\driver_finder.py", line 38, in get_path
File "C:\Users\diego\AppData\Local\Temp\OND5FF~1\selenium\webdriver\common\selenium_manager.py", line 89, in driver_lo
cation
File "C:\Users\diego\AppData\Local\Temp\OND5FF~1\selenium\webdriver\common\selenium_manager.py", line 73, in get_binar

selenium. common. exceptions. WebDriverException: Message: Unable to obtain working Selenium Manager binary; C:\Users\diego
\AppData\Local\Temp\OND5FF~1\selenium\webdriver\common\windows\selenium-manager. exe

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\diego\AppData\Local\Temp\OND5FF~1\p.py", line 8, in <module>
driver = webdriver. Chrome(options=chrome_options)
File "C:\Users\diego\AppData\Local\Temp\OND5FF~1\selenium\webdriver\chrome\webdriver.py", line 45, in __ init
File "C:\Users\diego\AppData\Local\Temp\OND5FF~1\selenium\webdriver\chromium\webdriver.py", line 49, in __ init_
File "C:\Users\diego\AppData\Local\Temp\OND5FF~1\selenium\webdriver\common\driver_finder.py", line 41, in get_path
selenium. common. exceptions. NoSuchDriverException: Message: Unable to obtain driver for chrome using Selenium Manager. ; F
or documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/dr
iver_location

Nuitka

Version 2.1
Non commercial

pip freeze

altgraph==0.17.4
annotated-types==0.6.0
anyio==4.3.0
attrs==23.2.0
auto-py-to-exe==2.42.0
bottle==0.12.25
bottle-websocket==0.2.9
certifi==2024.2.2
cffi==1.16.0
charset-normalizer==3.3.2
colorama==0.4.6
distro==1.9.0
Eel==0.16.0
exceptiongroup==1.2.0
future==1.0.0
gevent==24.2.1
gevent-websocket==0.10.1
greenlet==3.0.3
h11==0.14.0
httpcore==1.0.4
httpx==0.27.0
idna==3.6
Nuitka==2.1
openai==1.13.3
ordered-set==4.1.0
outcome==1.3.0.post0
packaging==23.2
pefile==2023.2.7
pillow==10.2.0
pycparser==2.21
pydantic==2.6.3
pydantic_core==2.16.3
pyinstaller==6.4.0
pyinstaller-hooks-contrib==2024.2
pyparsing==3.1.1
PySocks==1.7.1
python-dotenv==1.0.1
pywin32-ctypes==0.2.2
requests==2.31.0
schedule==1.2.1
selenium==4.18.1
sniffio==1.3.1
sortedcontainers==2.4.0
tqdm==4.66.2
trio==0.24.0
trio-websocket==0.11.1
typing_extensions==4.10.0
urllib3==2.2.1
webdriver-manager==4.0.1
whichcraft==0.6.1
wsproto==1.2.0
XlsxWriter==3.2.0
zope.event==5.0
zope.interface==6.2
zstandard==0.22.0
@kayhayen
Copy link
Member

kayhayen commented Mar 6, 2024

I assume this has very similar solution as playwright will get @KevinRodriguez777 can you then take this one on as well, once we got the raw_copy in-place?

@KRRT7
Copy link
Contributor

KRRT7 commented Mar 6, 2024

from selenium import webdriver

chrome_options = webdriver.ChromeOptions()
driver = webdriver.Chrome(options=chrome_options)
driver.get('https://www.google.com/')

I don't believe that to be the case, selenium doesn't bundle the drivers like playwright does, it uses already exisiting drivers / browsers and controls them directly, i could be wrong though, let me take a look.

@BAYU-SPAMMING
Copy link

Hello! I didn't use chromedriver in my project. With the new version of Selenium (4), it is no longer necessary to specify a chromedriver. However, this chromedriver management is not working.

My code is as simples as:

from selenium import webdriver

chrome_options = webdriver.ChromeOptions()
driver = webdriver.Chrome(options=chrome_options)
driver.get('https://www.google.com/')

The code runs on the system fine and when i don't use onefile.

Compiled it with: python -m nuitka --follow-imports --standalone --onefile --include-package=selenium main.py

When executing main.exe, I receive the following error:

Traceback (most recent call last):
File "C:\Users\diego\AppData\Local\Temp\OND5FF~1\selenium\webdriver\common\driver_finder.py", line 38, in get_path
File "C:\Users\diego\AppData\Local\Temp\OND5FF~1\selenium\webdriver\common\selenium_manager.py", line 89, in driver_lo
cation
File "C:\Users\diego\AppData\Local\Temp\OND5FF~1\selenium\webdriver\common\selenium_manager.py", line 73, in get_binar

selenium. common. exceptions. WebDriverException: Message: Unable to obtain working Selenium Manager binary; C:\Users\diego
\AppData\Local\Temp\OND5FF~1\selenium\webdriver\common\windows\selenium-manager. exe

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\diego\AppData\Local\Temp\OND5FF~1\p.py", line 8, in <module>
driver = webdriver. Chrome(options=chrome_options)
File "C:\Users\diego\AppData\Local\Temp\OND5FF~1\selenium\webdriver\chrome\webdriver.py", line 45, in __ init
File "C:\Users\diego\AppData\Local\Temp\OND5FF~1\selenium\webdriver\chromium\webdriver.py", line 49, in __ init_
File "C:\Users\diego\AppData\Local\Temp\OND5FF~1\selenium\webdriver\common\driver_finder.py", line 41, in get_path
selenium. common. exceptions. NoSuchDriverException: Message: Unable to obtain driver for chrome using Selenium Manager. ; F
or documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/dr
iver_location

Nuitka

Version 2.1 Non commercial

pip freeze

altgraph==0.17.4
annotated-types==0.6.0
anyio==4.3.0
attrs==23.2.0
auto-py-to-exe==2.42.0
bottle==0.12.25
bottle-websocket==0.2.9
certifi==2024.2.2
cffi==1.16.0
charset-normalizer==3.3.2
colorama==0.4.6
distro==1.9.0
Eel==0.16.0
exceptiongroup==1.2.0
future==1.0.0
gevent==24.2.1
gevent-websocket==0.10.1
greenlet==3.0.3
h11==0.14.0
httpcore==1.0.4
httpx==0.27.0
idna==3.6
Nuitka==2.1
openai==1.13.3
ordered-set==4.1.0
outcome==1.3.0.post0
packaging==23.2
pefile==2023.2.7
pillow==10.2.0
pycparser==2.21
pydantic==2.6.3
pydantic_core==2.16.3
pyinstaller==6.4.0
pyinstaller-hooks-contrib==2024.2
pyparsing==3.1.1
PySocks==1.7.1
python-dotenv==1.0.1
pywin32-ctypes==0.2.2
requests==2.31.0
schedule==1.2.1
selenium==4.18.1
sniffio==1.3.1
sortedcontainers==2.4.0
tqdm==4.66.2
trio==0.24.0
trio-websocket==0.11.1
typing_extensions==4.10.0
urllib3==2.2.1
webdriver-manager==4.0.1
whichcraft==0.6.1
wsproto==1.2.0
XlsxWriter==3.2.0
zope.event==5.0
zope.interface==6.2
zstandard==0.22.0

do you have solution??

@KRRT7
Copy link
Contributor

KRRT7 commented Mar 6, 2024

Thanks for the report, this should be available for use in the next release of nuitka.

@furjac
Copy link

furjac commented Mar 10, 2024

yes same issue for me
hope it gets fixed

@kayhayen kayhayen added the factory For issues fixed in factory only label Mar 11, 2024
@kayhayen
Copy link
Member

Thanks for your report, this is fixed on the factory branch, which is a development version under rapid development. You can try it out by going here: https://nuitka.net/doc/factory.html

Feedback if this is working is very welcome, just please do not share plans of doing it, but rather confirmations or denials of it working.

@furjac
Copy link

furjac commented Mar 14, 2024

@kayhayen u can close this issue the error has been solved its working ❤️

@KRRT7
Copy link
Contributor

KRRT7 commented Mar 14, 2024

@kayhayen u can close this issue the error has been solved its working ❤️

issues get closed once they hit main.

@furjac
Copy link

furjac commented Mar 14, 2024

ohhh ok i understand

@kayhayen
Copy link
Member

Part of the 2.1.3 hotfix release I just made.

@kayhayen kayhayen removed the factory For issues fixed in factory only label Mar 22, 2024
@furjac
Copy link

furjac commented Mar 22, 2024

@kayhayen how to force update to 2.1.3 now can anyone help

@KRRT7
Copy link
Contributor

KRRT7 commented Mar 22, 2024

@kayhayen how to force update to 2.1.3 now can anyone help

it'll be on pypi soon, be patient or install it from source
https://nuitka.net/doc/download.html#pypi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants