I have a gui ocr application in python. Script runs successfully. However when I build it via pyinstaller with the command below,
python -m PyInstaller --upx-dir='D:\upx-3.96-win64' --paths=Baris --add-data './images;images' --collect-all easyocr --onedir -w main.py
When I run the .exe , gui opens as expected but imread of skimage library fails with the following error. So far, I have tried onefile argument, reinstalled the libraries such imageio, scikit-image, skimage but nothing changed. Are there any suggestions? Thanks.
Error line in code:
from skimage import io
img = io.imread(img_file)
Error in runtime:
Traceback (most recent call last):
File "main.py", line 422, in <module>
File "main.py", line 209, in main
File "main.py", line 83, in Resnet
File "starter.py", line 180, in coreResnet
File "starter.py", line 145, in runResnet
File "text_detection2\resnet_detection.py", line 147, in run
File "text_detection2\imgproc.py", line 13, in loadImage
File "skimage\io\_io.py", line 53, in imread
img = call_plugin('imread', fname, plugin=plugin, **plugin_args)
File "skimage\io\manage_plugins.py", line 207, in call_plugin
return func(*args, **kwargs)
File "skimage\io\_plugins\imageio_plugin.py", line 10, in imread
return np.asarray(imageio_imread(*args, **kwargs))
File "imageio\__init__.py", line 86, in imread
File "imageio\v2.py", line 159, in imread
File "imageio\core\imopen.py", line 333, in imopen
ValueError: Could not find a backend to open `D:\Users\baris\PycharmProjects\Project - Kopya (3)\dist\main\images\3.png`` with iomode `ri`.
Based on the extension, the following plugins might add capable backends:
pillow: pip install imageio[pillow]
PNG-PIL: pip install imageio[pillow]
PNG-FI: pip install imageio[freeimage]
ITK: pip install imageio[simpleitk]