Skip to content
New issue

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

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

Already on GitHub? # to your account

Not work with pyinstaller #9

Open
yswtrue opened this issue Oct 23, 2021 · 1 comment
Open

Not work with pyinstaller #9

yswtrue opened this issue Oct 23, 2021 · 1 comment

Comments

@yswtrue
Copy link

yswtrue commented Oct 23, 2021

PS D:\Code\texas_auto\dist> .\main.exe
Traceback (most recent call last):
  File "main.py", line 17, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "PyInstaller\loader\pyimod03_importers.py", line 546, in exec_module
  File "auto.py", line 17, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "PyInstaller\loader\pyimod03_importers.py", line 546, in exec_module
  File "playwright_stealth\__init__.py", line 2, in <module>
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "PyInstaller\loader\pyimod03_importers.py", line 546, in exec_module
  File "playwright_stealth\stealth.py", line 17, in <module>
  File "playwright_stealth\stealth.py", line 13, in from_file
  File "pkg_resources\__init__.py", line 1142, in resource_string
  File "pkg_resources\__init__.py", line 1388, in get_resource_string
  File "pkg_resources\__init__.py", line 1555, in _get
  File "PyInstaller\loader\pyimod03_importers.py", line 371, in get_data
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\yswtrue\\AppData\\Local\\Temp\\_MEI131882\\playwright_stealth\\js\\chrome.csi.js'
[3644] Failed to execute script 'main' due to unhandled exception!
@yswtrue
Copy link
Author

yswtrue commented Oct 26, 2021

pyinstaller --add-data ".venv/Lib/site-packages/playwright_stealth;./playwright_stealth/" -F main.py

This works for me

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

No branches or pull requests

1 participant