Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading