Reputation: 67
How do I run my pyinstaller created script if it depends on functions stored in a different file?
I have a file, let's call file.py and in it, it has:
sys.path.insert(0, 'Functions')
from getDigits import getDigits
In my pyinstaller executable script that I create, it runs file.py and file2.py but only file.py uses the import getDigits function.
My error code is: ModuleNotFoundError: No module named 'getDigits'
even when I place the getDigits file in the same directory as the executable.
Do I need to use the full path or something and if so, how do I go about accomplishing this?
Also, another question how do I go about using icons for excutable: I used the following but it still doesn't show my executable file with desired icon. I have a folder.ico in the same directory.
pyinstaller --onefile --icon=folder.ico run_files.py
Upvotes: 0
Views: 259
Reputation: 2767
PyInstaller can't see path manipulations. Add each extra path when building with the -p <path>
option.
In your case -p path/to/script/directory/Functions
.
Upvotes: 1