Exception in Tkinter callback Traceback (most recent call last): File…
- User
Exception in Tkinter callback Traceback (most recent call last): File "D:\python\lib\tkinter_init_.py", line 1921, in call return self.func(*args) File "D:\zttj20230406\main_v2.0.py", line 66, in convertFile self.write2xls() File "D:\zttj20230406\main_v2.0.py", line 161, in write2xls self.wb = xlwings.Book(fp) File "D:\python\lib\site-packages\xlwings\main.py", line 898, in init impl = app.books.open( File "D:\python\lib\site-packages\xlwings\main.py", line 4955, in open raise FileNotFoundError("No such file: '%s'" % fullname) FileNotFoundError: No such file: 'c:\users\wxy\template.xlsx'
- Assistant
The error is raised when trying to open 'c:\users\wxy\template.xlsx' with xlwings. The file does not exist in the specified directory or the file name is incorrect. Check to make sure the file exists and the path is correct.
- User
Exception in Tkinter callback Traceback (most recent call last): File "D:\python\lib\tkinter_init_.py", line 1921, in call return self.func(*args) File "D:\zttj20230406\main_v2.0.py", line 66, in convertFile self.write2xls() File "D:\zttj20230406\main_v2.0.py", line 161, in write2xls self.wb = xlwings.Book(fp) File "D:\python\lib\site-packages\xlwings\main.py", line 898, in init impl = app.books.open( File "D:\python\lib\site-packages\xlwings\main.py", line 4955, in open raise FileNotFoundError("No such file: '%s'" % fullname) FileNotFoundError: No such file: 'c:\users\wxy\template.xlsx'报错怎么处理
- Assistant
该错误是在尝试使用xlwings打开 'c:\users\wxy\template.xlsx' 文件时发生的。该文件在指定的目录中不存在或文件名不正确。请检查文件是否存在且路径是否正确。您可以尝试创建一个此文件名的新文件并在正确的位置保存它,或者更改代码中的文件名,以与您要在其中保存数据的现有Excel工作簿的名称匹配。