python - py安装程序 "unable to find a txt file when adding a binary"

标签 python pyinstaller

当我使用 pyinstaller 将我的脚本转换为 exe 时,出现错误:-

Unable to find "c:\users\praveen\appdata\local\programs\python\python36\lib\site-packages\importlib_resources\version.txt" when adding binary and data files

您可以在此处查看完整错误:

https://drive.google.com/file/d/1FmV5kdb7p6TgEZwKBFDmFIszC-Qha0BD/view?usp=sharing

我的脚本有很多导入,它们是:-

import tkinter as tk  
import os 
import time
import sys
from PyQt5 import QtWidgets, QtCore, QtGui
from PIL import ImageGrab
import numpy as np
import cv2
import pytesseract 
import webview

这个错误是什么意思?为什么我会得到它?

最佳答案

您需要正确编写命令,例如:

pyinstaller --add-data web_folder;web_folder --add-data db.sqlite;. gui.py

描述:title_of_folder_or_file;path_to_it(如果你的 OS Windows 使用“;”,否则为“:”。在 Windows 上它是 100% 但在 linux 或 mac 上我不知道)你需要的文件夹;设置此文件夹的路径,例如 web_folder;web_folder

来源 - Official Documentation

关于python - py安装程序 "unable to find a txt file when adding a binary",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64022012/

相关文章:

python - Python 中的元类是什么?

python - 获取指定URL的所有参数

python - 如何在python中为flask-restful添加参数?

python - 如何使用 Pyinstaller 3.0 混淆 python 字节码

python - 加速已编译的 python 程序?

python - Pyinstaller 创建 Linux 二进制文件时出现以 '\xe8' 开头的非 UTF-8 代码错误

python - Tensorflow-gpu 与 pyinstaller

python - 从字段中的同一记录中检索值 odoo 10

python - 如何查找 Mechanize (python)发布的 POST 或 GET 变量

python - 获取 PyInstaller 导入 Basemap