我正在嘗試為一個專案制作一個可執行檔案,這樣我的朋友就不需要使用 pyinstaller 安裝 python
當使用帶有“-w”的pyinstaller時,
可執行檔案顯示屬性錯誤
Traceback (most recent call last):
File "main.py", line 7, in <module>
display = calendar_object.make_calendar()
AttributeError: 'Calendar' object has no attribute 'make_calendar'
但是當我在終端中打開 main.py 時,它完全沒問題。
當使用不帶“-w”的pyinstaller時,
它會立即打開和關閉,是的,我有一個while回圈和一個輸入,所以我猜我的檔案又出了問題
臨時解決方案:
將所有單獨的檔案插入一個檔案。
代碼示例:
main.py
calendar.py
uj5u.com熱心網友回復:
您似乎在為您的類使用一個模仿 python 內部日歷類的名稱。
重命名你的班級,你應該沒問題
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/465177.html
標籤:Python python-3.x 安装程序
上一篇:SyntaxError:(unicodeerror)'unicodeescape'codeccan'tdecodebytesinposition2-3:truncated
