I am trying to build a "One File" executable for my project with pyinstaller and a .spec file. The content of the spec file is as follows:
# -*- mode: python -*-
block_cipher = None
a = Analysis(['__main__.py'],
pathex=['D:\\opt_frame'],
binaries=[],
datas=[],
hiddenimports=['scipy.special', 'scipy.special.comb'],
hookspath=[],
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,
exclude_binaries=True,
name='__main__',
debug=False,
strip=False,
upx=True,
console=True )
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
name='__main__')
I am getting the following error when I am trying to run the executable:
File "site-packages\scipy\special\__init__.py", line 640, in <module>
File "d:\opt_frame\.venv\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 714, in load_module
module = loader.load_module(fullname)
ImportError: DLL load failed: The specified module could not be found.
It fails when trying to import scipy.special even though I have added it to hiddenimports section.
My environment is as follows:
- Windows 10
- python 3.6.6
- pyinstaller 3.3.1
- scipy 1.1.0