pyinstaller程序發佈問題記錄

注:下文中wslng爲用戶文件夾,注意替換

1.FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\wslng\\dist\\main\\astor\\VERSION'

將C:\Users\wslng\AppData\Local\Programs\Python\Python36\Lib\site-packages\astor文件夾複製C:\Users\wslng\dist\main目錄下即可。

2.執行如下命令

pyinstaller D:\Project\CdEnjoy\接觸網識別系統\CatenaryDetection\main.py  
--hidden-import PySide2.QtXml 
--distpath=D:\Project\CdEnjoy\接觸網識別系統\發佈 
--noconfirm

報錯RecursionError: maximum recursion depth exceeded

(1)打開C:\Users\wslng\main.spec,在block_cipher = None這行後面加入

import sys
sys.setrecursionlimit(900000)

(2)再次運行命令

pyinstaller main.spec

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章