gpt4 book ai didi

python - 使用 pyinstaller 后执行编译文件 "No module named ' scipy._lib.messagestream' 时出错

转载 作者:太空狗 更新时间:2023-10-29 18:20:52 32 4
gpt4 key购买 nike

我正在尝试编译我们的代码 https://bitbucket.org/OES_muni/massiveoes从 python 2.7 升级到 3.6 并同时移动到 scipy 1.0.0 后使用 pyinstaller。我在 64 位 win7 机器上工作。程序本身运行良好,pyinstaller 运行没有错误,但是当我尝试运行构建 exe 文件时,它给了我这个错误:

Traceback (most recent call last):   File "massiveOES\GUI.py", line 23, in <module>   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 <module> 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 <module> 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 <module> 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 <module> 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 <module> 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 <module> 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 <module> 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

最佳答案

好的,以下解决了我的直接问题:编辑 pyinstaller .spec 文件以使用 Scipy 添加以下隐藏导入:

 hiddenimports=['scipy._lib.messagestream']

参见 my question更多。

关于python - 使用 pyinstaller 后执行编译文件 "No module named ' scipy._lib.messagestream' 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47055712/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com