【发布时间】:2021-09-05 09:05:30
【问题描述】:
Python 代码在 python ILDE (python version3.9.5) 中运行流畅。然后我通过 pyinstaller 将 *.py 文件转换为 *.exe。在运行 *.exe 文件时,它显示错误“FileNotFound”,该错误在 python ILDE 中执行 *.py 文件时不会出现。
错误: Tkinter 回调异常
Traceback(最近一次通话最后一次):
文件“tkinter_init_.py”,第 1892 行,在 call
中文件“gui_script.py”,第 284 行,在执行中
文件“script_lsprepost_report.py”,第 80 行,在 func_report_automation 中
文件“func_files\lsp_output.py”,第 25 行,在 func_output_result 中
FileNotFoundError: [Errno 2] 没有这样的文件或目录: 'D:/Glass_failure/M22_ball_drop/Iter_06_03/for_script/script_output/pid_4/Von_mises_stress_4.txt'
请注意,未找到的文件路径实际上是存在的。我通过将整个路径放在Windows机器的地址栏中手动检查它。
【问题讨论】:
标签: python-3.x windows-10 pyinstaller