The first time you run the pyinstaller myscript.py in cmd, the myscript.spec file will be created (or you can create it manually). This file allows you to specify a hidden import, and I discovered (through long and tedious trial error processes) that the following hidden import did the trick:
'scipy.special._ufuncs_cxx' 'scipy.linalg.cython_blas' 'scipy.linalg.cython_lapack' 'scipy.integrate' 'scipy.integrate.quadrature' 'scipy.integrate.odepack' 'scipy.integrate._odepack' 'scipy.integrate.quadpack' 'scipy.integrate._quadpack' 'scipy.integrate._ode' 'scipy.integrate.vode' 'scipy.integrate._dop' 'scipy.integrate.lsoda'
This is probably due to the hooks, but I could not figure out how to do this, so this is a βquick and dirtyβ way.
You are now executing pyinstaller myscript.spec .
My complete file looked like this:
# -*- mode: python -*- a = Analysis(['myscript.py'], pathex=['C:\\SourceCode'], hiddenimports=['scipy.special._ufuncs_cxx', 'scipy.linalg.cython_blas', 'scipy.linalg.cython_lapack', 'scipy.integrate', 'scipy.integrate.quadrature', 'scipy.integrate.odepack', 'scipy.integrate._odepack', 'scipy.integrate.quadpack', 'scipy.integrate._quadpack', 'scipy.integrate._ode', 'scipy.integrate.vode', 'scipy.integrate._dop', 'scipy.integrate.lsoda'], hookspath=None, runtime_hooks=None) pyz = PYZ(a.pure) exe = EXE(pyz, a.scripts, exclude_binaries=True, name='myscript.exe', debug=False, strip=None, upx=True, console=True ) coll = COLLECT(exe, a.binaries, a.zipfiles, a.datas, strip=None, upx=True, name='myscript')