Exe-file not working with pandas_ta?

244 views
Skip to first unread message

RapidTech 1898

unread,
Apr 30, 2021, 2:51:03 AM4/30/21
to PyInstaller
I am using pyinstaller for a long time for different programs but now i ran in an issue with the pandas_ta module which i use for the first time

Program works fine in vscode and starting from the terminal.

I compiled the py-file as allways with: pyinstaller --onefile StockRT.py
(and it worked fine and created the exe as allways)

But when i want to run the exe i get this error message:
  File "StockRT.py", line 30, in <module>
    import pandas_ta as ta
  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 531, in exec_module
  File "pandas_ta\__init__.py", line 10, in <module>
  File "pkg_resources\__init__.py", line 480, in get_distribution
  File "pkg_resources\__init__.py", line 356, in get_provider
  File "pkg_resources\__init__.py", line 899, in require
  File "pkg_resources\__init__.py", line 785, in resolve
pkg_resources.DistributionNotFound: The 'pandas_ta' distribution was not found and is required by the application
[19892] Failed to execute script StockRT

Tried to compile the exe in the venv (what i normally do - and also in the globally environment) - error message keeps the same.

Any tipp / help would be very welcome - thanks in advance!

RapidTech 1898

unread,
Apr 30, 2021, 4:52:50 AM4/30/21
to PyInstaller
I found an answer to that on the official pyinstaller-git-page -

With that command everything works fine:
pyinstaller --copy-metadata pandas_ta --onefile StockRT.py

(this function should be available since version 4.3. of pyinstaller)

KR
Reply all
Reply to author
Forward
0 new messages