rnso
rnso

Reputation: 24623

pyinstaller error with scipy package

I am trying to create an exe file with following command:

pyinstaller -F myfile.py

I was getting error on No module named 'pandas._libs.tslibs.timedeltas' in PyInstaller and it got solved by creating a hook-pandas.py file with following line in it as described on that page.

`hiddenimports = ['pandas._libs.tslibs.timedeltas']`

But now I am getting following error:

...
  File "site-packages\scipy\optimize\_trlib\__init__.py", line 1, in <module>
  File "e:\0-anaconda\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 714, in load_module
    module = loader.load_module(fullname)
  File "messagestream.pxd", line 5, in init scipy.optimize._trlib._trlib
ModuleNotFoundError: No module named 'scipy._lib.messagestream'
[4380] Failed to execute script myfile

Following same pattern as above, I created another file named hook-scipy.py and put following line in it:

hiddenimports = ['scipy._lib.messagestream']

But the error has persisted. Where is the problem and how can it be solved?

(I am using python version 3.6.4 Anaconda and pyinstaller version 3.3.1 on Windows 7 operating system).

Upvotes: 0

Views: 922

Answers (1)

Jonathan W.
Jonathan W.

Reputation: 11

I recently had a similar issue and specifying:

hiddenimports=['scipy._lib.messagestream']

is not enough. I was able to get my issue, at least, to work when specifying:

hiddenimports=['scipy._lib.messagestream', 'scipy']

BTW this is for Python 3.6.1, PyInstaller 3.3.1 and scipy 1.2.1 on macOS.

Upvotes: 1

Related Questions