当我使用pyinstaller将脚本转换为exe时,我得到了一个错误:-
Unable to find "c:userspraveenappdatalocalprogramspythonpython36libsite-packagesimportlib_resourcesversion.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(如果你的操作系统Windows使用",否则":"。在Windows上它是100%,但在linux或mac上我不知道(之后你需要的文件夹;设置该文件夹的路径,例如web_folder;web_folder
来源-官方文件