Доброго дня форумчане!
Начал копать python. В VSCode Создал виртуальную среду, Написал скрипт,установил все необходимые библиотеки.
В VSCode запускается, всё работает как часы. При запуске скомпилированного в "exe" ругается, что не находит библиотеку.
Команда такая
PS C:\Projects\PyQRMDL> pyinstaller --onefile PyQRMDlab.py --icon="logoPDF.png"
при запуске скомпилированного файла из командной строки выходит ошибка:
C:\Projects\PyQRMDL\dist>PyQRMDlab.exe
Traceback (most recent call last):
File "PyInstaller\loader\pyimod03_ctypes.py", line 53, in __init__
File "ctypes\__init__.py", line 374, in __init__
FileNotFoundError: Could not find module 'libiconv.dll' (or one of its dependencies). Try using the full path with constructor syntax.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "pyzbar\zbar_library.py", line 58, in load
File "pyzbar\zbar_library.py", line 50, in load_objects
File "pyzbar\zbar_library.py", line 51, in <listcomp>
File "ctypes\__init__.py", line 452, in LoadLibrary
File "PyInstaller\loader\pyimod03_ctypes.py", line 55, in __init__
pyimod03_ctypes.install.<locals>.PyInstallerImportError: Failed to load dynlib/dll 'libiconv.dll'. Most likely this dynlib/dll was not found when the application was frozen.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "PyInstaller\loader\pyimod03_ctypes.py", line 53, in __init__
File "ctypes\__init__.py", line 374, in __init__
FileNotFoundError: Could not find module 'C:\Users\MI\AppData\Local\Temp\_MEI350762\pyzbar\libiconv.dll' (or one of its dependencies). Try using the full path with constructor syntax.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "PyQRMDlab.py", line 4, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
File "pyzbar\pyzbar.py", line 7, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
File "pyzbar\wrapper.py", line 151, in <module>
File "pyzbar\wrapper.py", line 148, in zbar_function
File "pyzbar\wrapper.py", line 127, in load_libzbar
File "pyzbar\zbar_library.py", line 60, in load
File "pyzbar\zbar_library.py", line 50, in load_objects
File "pyzbar\zbar_library.py", line 51, in <listcomp>
File "ctypes\__init__.py", line 452, in LoadLibrary
File "PyInstaller\loader\pyimod03_ctypes.py", line 55, in __init__
pyimod03_ctypes.install.<locals>.PyInstallerImportError: Failed to load dynlib/dll 'C:\\Users\\MI\\AppData\\Local\\Temp\\_MEI350762\\pyzbar\\libiconv.dll'. Most likely this dynlib/dll was not found when the application was frozen.
[34512] Failed to execute script 'PyQRMDlab' due to unhandled exception!
Сама библиотека на месте:
C:\Projects\PyQRMDL\.venv\Lib\site-packages\pyzbar\libiconv.dll
Подскажите, что я делаю не так?
Заранее благодарен
Знаю тема не новая и именно с этой библиотекой находил аналогичные темы, но то-ли мне мозгов не хватает, то ли все таки что-то другое