我想凍結一個基於控制檯的程序,它使用matplotlib.pyplot來生成並保存圖。 (我並不需要預覽或查看地塊,無論如何都保存之前他們。)這是我的setup.py腳本:問題與matplotlib和cx_freeze
from cx_Freeze import setup, Executable
import os
os.environ['TCL_LIBRARY'] = "C:\\Program Files\\Anaconda3\\tcl\\tcl8.6"
os.environ['TK_LIBRARY'] = "C:\\Program Files\\Anaconda3\\tcl\\tk8.6"
setup(name='FLOUResence.exe',
version='0.1',
options = {"build_exe": {"packages":["pandas", "numpy", "scipy", "matplotlib"]}
},
executables = [Executable(script='caller.py', targetName='FLOUResence.exe',
icon="icon.ico", base='Console')]
)
我可以編譯程序,但是當我運行繪圖模塊則返回以下錯誤:
This application failed to start because it could not find or load the Qt platform plugin "windows" in "".
Reinstalling the application may fix this problem.
從我可以告訴,因爲matplotlib要加載/使用Qt的圖形用戶界面,而是因爲它是一個控制檯應用程序cx_freeze不加載的Qt?這是對問題的正確解釋嗎?有關如何解決這個問題的任何想法?