使用pyinstaller和scipy模块将py文件转换为exe文件时出错。知道可能是什么问题吗?

问题描述 投票:1回答:1

我正在运行Python 3.6.4,OS Windows 10 Home 64位

这不是给我这个问题的原始代码,但写了一个非常简单的代码来证明scipy给了我错误。

from scipy.optimize import fsolve
print('Hello World')
close_this = input('Press ENTER to close.')

然后我使用cmd中的以下代码将此文件(hello.py)转换为exe文件。

pyinstaller -F Hello.py

我收到了多个警告。所有人都说“未找到lib”

52530 WARNING: lib not found: libopenblas.JKAMQ5EVHIVCPXP2XZJB2RQPIN47S32M.gfortran-win32.dll dependency of c:\program files (x86)\python36-32\lib\site-packages\scipy\special\_ellip_harm_2.cp36-win32.pyd

然后我运行了我新创建的exe文件(hello.exe)。它闪过一秒钟,瞬间坠毁。它给我的错误是它找不到scipy模块。

File "Hello.py", line 1, in <module>
...
ImportError: DLL load faild: The specified module could not be found.  

当我尝试转换没有第1行的python文件(导入scipy)。我没有错误,并正确转换为exe。

这是我得到的。我感谢任何帮助。 :)

python python-3.x scipy pyinstaller py2exe
1个回答
0
投票

我的解决方案是简单地更新PyInstaller。

https://pyinstaller.readthedocs.io/en/v3.3.1/installation.html

© www.soinside.com 2019 - 2024. All rights reserved.