0

Though the conversion from *.py- to a standalone *.exe-file via the command "pyinstaller --onefile filename.py" can be completed successfully, the executable itself failes to run

Traceback (most recent call last): File "venv\Lib\site-packages\PyInstaller\loader\rthooks\pyi_rth_pkgres.py", line 13, in File "c:\users\user01\pycharmprojects\api4trd\venv\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module exec(bytecode, module.dict) File "lib\site-packages\pkg_resources__init__.py", line 86, in ModuleNotFoundError: No module named 'pkg_resources.py2_warn' [13560] Failed to execute script pyi_rth_pkgres

following packages are used

1) math

2) datetime

3) yfinance

Python version: 3.8.1

pyinstaller version: 3.6

OS:W10

Thank you!

1 Answer 1

0

You are missing one hidden import in your pyinstaller command. Although earlier version of Python and Pyinstaller never used to give this error, but nevertheless here is the solution

pyinstaller --onefile --hidden-import=pkg_resources.py2_warn filename.py
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.