dll – can’nt run python program due to certain pyzbar error ( conda and pycharm )

error on running code

C:\ProgramData\anaconda3\python.exe C:\Users\deep2\PycharmProjects\pythonProject4\main.py 
Traceback (most recent call last):
  File "C:\Users\deep2\AppData\Roaming\Python\Python310\site-packages\pyzbar\zbar_library.py", line 58, in load
    dependencies, libzbar = load_objects(Path(''))
  File "C:\Users\deep2\AppData\Roaming\Python\Python310\site-packages\pyzbar\zbar_library.py", line 50, in load_objects
    deps = [
  File "C:\Users\deep2\AppData\Roaming\Python\Python310\site-packages\pyzbar\zbar_library.py", line 51, in <listcomp>
    cdll.LoadLibrary(str(directory.joinpath(dep)))
  File "C:\ProgramData\anaconda3\lib\ctypes\__init__.py", line 452, in LoadLibrary
    return self._dlltype(name)
  File "C:\ProgramData\anaconda3\lib\ctypes\__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'libiconv.dll' (or one of its dependencies). Try using the full path with constructor syntax.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\deep2\PycharmProjects\pythonProject4\main.py", line 2, in <module>
    from pyzbar.pyzbar import decode
  File "C:\Users\deep2\AppData\Roaming\Python\Python310\site-packages\pyzbar\pyzbar.py", line 7, in <module>
    from .wrapper import (
  File "C:\Users\deep2\AppData\Roaming\Python\Python310\site-packages\pyzbar\wrapper.py", line 151, in <module>
    zbar_version = zbar_function(
  File "C:\Users\deep2\AppData\Roaming\Python\Python310\site-packages\pyzbar\wrapper.py", line 148, in zbar_function
    return prototype((fname, load_libzbar()))
  File "C:\Users\deep2\AppData\Roaming\Python\Python310\site-packages\pyzbar\wrapper.py", line 127, in load_libzbar
    libzbar, dependencies = zbar_library.load()
  File "C:\Users\deep2\AppData\Roaming\Python\Python310\site-packages\pyzbar\zbar_library.py", line 60, in load
    dependencies, libzbar = load_objects(Path(__file__).parent)
  File "C:\Users\deep2\AppData\Roaming\Python\Python310\site-packages\pyzbar\zbar_library.py", line 54, in load_objects
    libzbar = cdll.LoadLibrary(str(directory.joinpath(fname)))
  File "C:\ProgramData\anaconda3\lib\ctypes\__init__.py", line 452, in LoadLibrary
    return self._dlltype(name)
  File "C:\ProgramData\anaconda3\lib\ctypes\__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'C:\Users\deep2\AppData\Roaming\Python\Python310\site-packages\pyzbar\libzbar-64.dll' (or one of its dependencies). Try using the full path with constructor syntax.

Process finished with exit code 1

caant run the code in pycharm due to this error and on searching the missing file i actually fount the file file on the location
installed VC_redist.x64.exe also the file lizbar-64.dll is present enter image description here

Read more here: Source link