python - 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'
解决方案
我想出了问题的解决方案,它正在寻找一个不存在的文件夹。这是我修复它的方法:https ://youtu.be/bB9RXak4eVY
推荐阅读
- php - 为什么'init'钩子不起作用?
- python - 如果脚本包含 dlopen(),Python 2.7 API PyImport_ImportModule() 返回 NULL
- security - 我可以使用散列密码加密 zip 文件并使用未散列的密码对其进行解密吗?
- r - 如何在 R 中检查文件的幻数(或十六进制签名)?
- java - 除了前面没有字符串的特定字符之外的所有内容的正则表达式
- javascript - 当单击事件生成行时,如何在选择选项中获取数组值?
- regex - 带有正则表达式的 JSONPath 过滤器返回数组中的所有值而不是子集
- c++ - Spoj BTCK 的 TLE
- html - Bootstrap 4 制作相同的按钮
- java - Java 8 LocalDateTime 在解析具有 00 秒的日期字符串值时丢弃 00 秒值,例如“2018-07-06 00:00:00”