简体   繁体   中英

exe generated by pyinstaller throws 'Permission denied' error

I write a python script to process some data in excel file and I use tkinter to generate a UI to input some paramaters, including input file path and output file path.

I use pyinstaller to package the script into exe. When I run the exe and input the paramaters in the UI, the following error appears:

Exception in Tkinter callback
Traceback (most recent call last):
  File "tkinter\__init__.py", line 1892, in __call__
  File "ut_calculate_tool.py", line 130, in calculate_data
  File "styleframe\style_frame.py", line 318, in ExcelWriter
  File "pandas\io\excel\_openpyxl.py", line 52, in __init__
  File "pandas\io\excel\_base.py", line 925, in __init__
  File "pandas\io\common.py", line 711, in get_handle
PermissionError: [Errno 13] Permission denied: 'C:/Users/XinDong/Documents/UT Calculate'

The path 'C:/Users/XinDong/Documents/UT Calculate' is the output path I typed into the UI.

Does anyone know how to deal with the bug? Thanks in advance.

错误的原因是我的代码逻辑,而不是pyinstaller,我应该将文件名传递给后端,而不是文件夹...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM