pyinstaller "unable to find a txt file when adding a binary"

Viewed 1963

When i was converting my script to exe using pyinstaller i got an error:-

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

You can view the full error here:

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

my script has alot of imports, they are:-

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

what does that error mean? and why am i getting it?

1 Answers

You need to write the command correctly, example:

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

Description: title_of_folder_or_file;path_to_it (if your OS Windows use ";", else ":". On windows it's 100% but on linux or mac i don't know) for folder you need after ; set path to this folder, example web_folder;web_folder

Source - Official Documentation

Related