[徵才] (已解決)徵求解決pyinstaller 打包exe的 MEIPASS

作者: imhandmore (imhandmore)   2022-01-23 20:15:24
我用OpennCC模組製作程式碼,我在IDE環境上面可以順利執行
但等到我用pyinstaller 打包成exe之後就會顯示下列錯誤:
Traceback (most recent call last):
File "converter2.py", line 20, in <module>
File "opencc\opencc.py", line 55, in __init__
File "opencc\opencc.py", line 106, in _init_dict
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Claude\\AppData\\Local\\Temp\\_MEI151842\\opencc\\config\\s2tw.json'
[20160] Failed to execute script converter2
作者: MoonCode (MoonCode)   2022-01-23 21:44:00
https://stackoverflow.com/questions/55312146/how-to-include-only-needed-modules-in-pyinstaller
作者: IcecreamHsu (冰淇淋)   2022-01-24 00:00:00
你要在 path 前面加 sys._MEIPASS 吧
作者: snow10725 (今天天氣不錯)   2022-02-03 13:48:00
存參

Links booklink

Contact Us: admin [ a t ] ucptt.com