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

Pyinstaller executable fails #102

Open
AlexPaiva opened this issue Sep 4, 2023 · 3 comments
Open

Pyinstaller executable fails #102

AlexPaiva opened this issue Sep 4, 2023 · 3 comments
Assignees
Labels
dev Development for dev branch enhancement New feature or request

Comments

@AlexPaiva
Copy link

Describe the bug
Using pyinstalelr to turn a script into an .exe makes the driver not open, simply flash a console and not open.

To Reproduce

from selenium_profiles.webdriver import Chrome
from selenium_profiles.profiles import profiles
from selenium_driverless.webdriver import ChromeOptions
from selenium_driverless.types.by import By

profile = profiles.Windows()  # or .Android
options = ChromeOptions()
# options.add_argument("--headless=new")
driver = Chrome(profile, options=options, driverless_options=True)

# get url
driver.get('https://nowsecure.nl#relax')  # test fingerprint

driver.quit()  # Execute on the End!

Expected behavior or error-message
A clear and concise description of what you expected to happen.

No error messages

Environment (please complete the following information):

  • OS: Windows
  • OS-Version 10
  • Browser Chrome latest
  • Selenium-Profiles Version Latest
  • Selenium Version Latest
  • selenium-driverless Version Latest
  • Python versin 3.10

Additional context
Initially it gave a missing 'Failed to execute script 'pyi_rth_wind32api' due to unhandled exception: DLL load failed' error but manually adding it as a binary import seems to work.

@AlexPaiva
Copy link
Author

AlexPaiva commented Sep 4, 2023

Also getting:

2023-09-05 00:10:34 - FATAL ERROR OCCURED: Traceback (most recent call last):
  File "main.py", line 4495, in signup
  File "concurrent\futures\_base.py", line 446, in result
  File "concurrent\futures\_base.py", line 391, in __get_result
  File "concurrent\futures\thread.py", line 58, in run
  File "main.py", line 4199, in gamiCalli
  File "selenium_profiles\profiles\profiles.py", line 12, in Windows
  File "selenium_profiles\profiles\profiles.py", line 6, in return_profile
  File "selenium_profiles\utils\utils.py", line 33, in read_json
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Alex\\AppData\\Local\\Temp\\_MEI105282\\selenium_profiles/profiles/default.json'

I fixed that with manual json imports and making the utils.py and profiles.py code pyinstaller safe but still it just keeps trying to open a node console over and over again without any error

@kaliiiiiiiiii
Copy link
Owner

@AlexPaiva

  1. Have you checked if the --user-data-dir=C:/some_path/data is valid?
  2. The chrome process starts at https://github.com/kaliiiiiiiiii/Selenium-Driverless/blob/4e478d26ce7090192ff45d835e1efb31bd7bf98c/src/selenium_driverless/webdriver.py#L220 , check what path & arguments are there.

@kaliiiiiiiiii
Copy link
Owner

@AlexPaiva Does it work with driverless_options=False btw?

@kaliiiiiiiiii kaliiiiiiiiii changed the title Pyinstaller makes this not working Pyinstaller executable fails Sep 5, 2023
@kaliiiiiiiiii kaliiiiiiiiii added the enhancement New feature or request label Sep 5, 2023
@kaliiiiiiiiii kaliiiiiiiiii self-assigned this Sep 5, 2023
@kaliiiiiiiiii kaliiiiiiiiii added the dev Development for dev branch label Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev Development for dev branch enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants