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.
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