簡體   English   中英

使用pyinstaller和scipy模塊將py文件轉換為exe文件時出錯。 知道可能是什么問題嗎?

[英]Error when converting py file to exe file using pyinstaller and scipy module. Any idea what could be the problem?

我正在運行Python 3.6.4,操作系統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。

據我所知。 我感謝您提供的任何幫助。 :)

我的解決方案是僅更新PyInstaller。

https://pyinstaller.readthedocs.io/zh-CN/v3.3.1/installation.html

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM