'Issue with pptk when compling .exe in pyinstaller

I'm trying to compile a .exe file using pyinstaller, I get the following error when I try to run the resulting .exe.

I used the command pyinstaller --paths=venv\Lib\site-packages pcpro.py with and without the -F for single file. Do I need to copy a DLL or specify where to find it? Any pointers would be gratefully received.

Traceback (most recent call last):
  File "pcpro.py", line 7, in <module>
  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
  File "pptk\__init__.py", line 3, in <module>
  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
  File "pptk\points\points.py", line 4, in <module>
ImportError: DLL load failed: The specified module could not be found.
[35112] Failed to execute script 'pcpro' due to unhandled exception!

I've looked in the pptk folders, the line in points.py on line 4 is from ..kdtree import kdtree. Inside that directory there is kdtree.pyd



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source