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