Assume that this is my file structure:
main.py
modules
|--> feature1.py
|--> feature2.py
|--> feature3.py
My main.py
code is as following:
from modules.feature1 import Awesomefeature
...
I used the following spec-file for PyInstaller:
# -*- mode: python -*-
block_cipher = None
a = Analysis(['main.py'],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
name='main',
debug=False,
strip=False,
upx=False,
runtime_tmpdir=None,
console=True , icon='icon.ico')
Unfortunately I get the following message after I compile my code to a windows executable and execute this (main.exe file):
ModuleNotFoundError: no module named 'modules'
Is it completely impossible to have subfolders with pythoncode in it while using pyinstaller?