我使用Python 2.7的Windows 8pyinstaller - 導入錯誤:沒有模塊名爲Tkinter的(決定所有變體)
當我面對這個問題,它仍然不知道它擁有多少陷阱。在這裏,我想介紹我遇到和測試過的所有選項,以及我最終幫助的選項。
1)我檢查了模塊Tkinter or tkinter使用的拼寫。
2)我瞭解如何使用pyinstaller
,在項目模塊使用時:tkinter
和matplotlib
然後能夠放棄matplotlib
,但它也沒有影響到解決我的問題。
3)從與所述參數p
PyInstaller -y -F --distpath="." -p "C:\Python27\Lib\lib-tk" test.py
4的命令行)只連接模塊https://groups.google.com/forum/#!topic/pyinstaller/vtbKKt6v0is
5)使用pyinstaller選項--hiddenimport=Tkinter
的必要部分將路徑添加到模塊和評論行excludedimports
文件\PyInstaller\hooks\hook-PIL.py
和hook-PIL.SpiderImagePlugin.py
https://github.com/pyinstaller/pyinstaller/issues/1584