Rob Hartnagel
Rob Hartnagel

Reputation: 3

Pyinstaller not including the FoxitSDK module when turning a .py to an executable

I made a program in python that removes all but the first page of a pdf in a whole directory tree and makes a copy of the tree, and it all works fine as a .py file, but I wanted to turn it into an .exe so that it can be used on a computer that doesn't have python or the libraries. When I run pyinstaller.exe --onefile ./filename.py, it makes an exe but when I run it, it gives me this error:

Traceback (most recent call last):
  File "OnlyFirstPage.py", line 5, in <module>
    from FoxitPDFSDKPython3 import *
  File "PyInstaller\loader\pyimod02_importers.py", line 385, in exec_module
  File "FoxitPDFSDKPython3\__init__.py", line 8, in <module>
ModuleNotFoundError: No module named 'fsdk'

I tried adding --hidden-import=FoxitPDFSDKPython3 to the command, but got the same problem.

Upvotes: 0

Views: 146

Answers (1)

Monty Python
Monty Python

Reputation: 501

Do you have __init__.py file , is that file in same folder as ./filename.py, if not . Put it in same folder as ./filename.py .

if that didn't work , try this !

pyinstaller.exe --onefile --paths=D:\env\Lib\site-packages (put path to python packages here) .\filename.py

Upvotes: 0

Related Questions