首页 > 解决方案 > How to fix PackageNotFoundError for exe files

问题描述

It gives me the error only after I have converted it to an exe, works fine as a .py file

I tried to find the file missing and replace it but it still didn't work. The error I get is:

Traceback (most recent call last):

File "tkinter_init_.py", line 1705, in call

File "CompilerGui.py", line 259, in

done = ttk.Button(window, text="Compile", command=lambda:finish(texts, window, search_folder))

File "CompilerGui.py", line 210, in finish cb.the_main(q_list, values)

File "CompilerBase.py", line 323, in the_main

file_written = write_docx(values_dict, file_to_write)

File "CompilerBase.py", line 100, in write_docx

my_docx = docx.Document()

File "site-packages\docx\api.py", line 25, in Document

File "site-packages\docx\opc\package.py", line 128, in open

File "site-packages\docx\opc\pkgreader.py", line 32, in from_file

File "site-packages\docx\opc\phys_pkg.py", line 31, in new

docx.opc.exceptions.PackageNotFoundError: Package not found at 'C:\Users\LENOVO\AppData\Local\Temp_MEI92522\docx\templates\default.docx'

标签: pythonpyinstallerpython-docx

解决方案


我想出了问题的解决方案,它正在寻找一个不存在的文件夹。这是我修复它的方法:https ://youtu.be/bB9RXak4eVY


推荐阅读