Python 環境相關問題

--

Pyinstaller封裝執行檔之後無法執行

Failed to executed script

嘗試過的辦法
降低Python版本: 3.8 > 3.7.9
建立虛擬環境: virtualenv

最後解決辦法
降低matplotlib版本: 3.3> 3.2.2

根據github上這篇2020.07.18的貼文matplotlib是不支援3.7以上的Python。
後來我在Python3.7的環境下透過pip install matplotlib==3.2.2 指令,成功降低版本,並且能夠順利執行封裝後的執行檔。

https://github.com/pyinstaller/pyinstaller/issues/5004

也就是說,至少確定在2020.11之後,pyinstaller 4.0 是能夠與 Python3.7、matplotlib3.2.2、numpy1.19.2,以及tkinter8.6互相兼容的。

debug過程中的參考資料
覺得台部落的這篇還滿有用的,pyinstaller打包單個exe後無法執行錯誤的解決方法。裡面提到可以先使用-D 參數進行打包,接著通過命令執行.exe檔案,即可看到檔案提示的錯誤。

blabalbalbalbalal

製作UI時,無法在繪圖之後讀取其他輸入

_tkinter.TclError: invalid command name “.!entry3”

因為plot 接在get() 前面,所以被plot卡住沒辦法get entry裡頭的資料。
必須把plot移動到別的地方,例如移到這個method的最後面,或是這次我是直接放到另外一個method的最後。

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Qertile 郭泰爾
Qertile 郭泰爾

Written by Qertile 郭泰爾

學習路上順便做點筆記留下痕跡OUO,怕以後忘了曾經所學的這些知識。

No responses yet

Write a response