Error when executing compiled file “ No module named 'scipy._lib.messagestream' ”after using pyinstaller

匿名 (未验证) 提交于 2019-12-03 02:03:01

问题:

i am trying to complile our code https://bitbucket.org/OES_muni/massiveoes using pyinstaller after upgrading from python 2.7 to 3.6 and moving to scipy 1.0.0 at same time. I am working on 64bit win7 machine. The program itself runs fine, pyinstaller runs without errors but when i try to run the build exe file it gives me this error:

Traceback (most recent call last):   File "massiveOES\GUI.py", line 23, in    File "c:\users\petr\envs\py1\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module     exec(bytecode, module.__dict__)   File "massiveOES\__init__.py", line 1, in    File "c:\users\petr\envs\py1\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module     exec(bytecode, module.__dict__)   File "massiveOES\FHRSpectra.py", line 1, in    File "c:\users\petr\envs\py1\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module     exec(bytecode, module.__dict__)   File "massiveOES\spectrum.py", line 3, in    File "c:\users\petr\envs\py1\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module     exec(bytecode, module.__dict__)   File "site-packages\scipy\optimize\__init__.py", line 241, in    File "c:\users\petr\envs\py1\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module     exec(bytecode, module.__dict__)   File "site-packages\scipy\optimize\_minimize.py", line 28, in    File "c:\users\petr\envs\py1\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module     exec(bytecode, module.__dict__)   File "site-packages\scipy\optimize\_trustregion_krylov.py", line 2, in    File "c:\users\petr\envs\py1\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module     exec(bytecode, module.__dict__)   File "site-packages\scipy\optimize\_trlib\__init__.py", line 1, in  File "c:\users\petr\envs\py1\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' [2128] Failed to execute script GUI

回答1:

OK, the following solved the immediate issue for me: edit the pyinstaller .spec file to add the following hidden import with Scipy:

 hiddenimports=['scipy._lib.messagestream']

See my question for more.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!