Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileNotFoundError: Could not find module 'libzbar-64.dll' (or one of its dependencies). Try using the full path with constructor syntax. #93

Open
giacomomarchioro opened this issue Feb 19, 2021 · 23 comments

Comments

@giacomomarchioro
Copy link

Thanks for this wonderful tool.

I am using Python 3.8.3 (default, Jul 2 2020, 17:30:36) [MSC v.1916 64 bit (AMD64)] on Windows 10.

After pip installing pyzbar I have got the following dll import errors:

Traceback (most recent call last):

  File "C:\Users\xxxx\anaconda3\lib\site-packages\pyzbar\zbar_library.py", line 58, in load
    dependencies, libzbar = load_objects(Path(''))

  File "C:\Users\xxxxx\anaconda3\lib\site-packages\pyzbar\zbar_library.py", line 54, in load_objects
    libzbar = cdll.LoadLibrary(str(directory.joinpath(fname)))

  File "C:\Users\xxxxx\anaconda3\lib\ctypes\__init__.py", line 451, in LoadLibrary
    return self._dlltype(name)

  File "C:\Users\xxxxx\anaconda3\lib\ctypes\__init__.py", line 373, in __init__
    self._handle = _dlopen(self._name, mode)

FileNotFoundError: Could not find module 'libzbar-64.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\PhaseONE-Rainbow\Desktop\libraryframework-master\libraryframework-master\libfrem\registro_movimentiv3.py", line 3, in <module>
    from AcquireQR import acquireQRandInfo

  File "C:\Users\xxxx\Desktop\libraryframework-master\libraryframework-master\libfrem\AcquireQR.py", line 2, in <module>
    from pyzbar import pyzbar

  File "C:\Users\xxxx\anaconda3\lib\site-packages\pyzbar\pyzbar.py", line 7, in <module>
    from .wrapper import (

  File "C:\Users\xxxxxx\anaconda3\lib\site-packages\pyzbar\wrapper.py", line 139, in <module>
    zbar_version = zbar_function(

  File "C:\Users\xxxxxx\anaconda3\lib\site-packages\pyzbar\wrapper.py", line 136, in zbar_function
    return prototype((fname, load_libzbar()))

  File "C:\Users\xxxxxx\anaconda3\lib\site-packages\pyzbar\wrapper.py", line 115, in load_libzbar
    libzbar, dependencies = zbar_library.load()

  File "C:\Users\xxxxxxx\anaconda3\lib\site-packages\pyzbar\zbar_library.py", line 60, in load
    dependencies, libzbar = load_objects(Path(__file__).parent)

  File "C:\Users\xxxxxx\anaconda3\lib\site-packages\pyzbar\zbar_library.py", line 54, in load_objects
    libzbar = cdll.LoadLibrary(str(directory.joinpath(fname)))

  File "C:\Users\xxxxx\anaconda3\lib\ctypes\__init__.py", line 451, in LoadLibrary
    return self._dlltype(name)

  File "C:\Users\xxxxx\anaconda3\lib\ctypes\__init__.py", line 373, in __init__
    self._handle = _dlopen(self._name, mode)

FileNotFoundError: Could not find module 'C:\Users\xxxxx\anaconda3\lib\site-packages\pyzbar\libzbar-64.dll' (or one of its dependencies). Try using the full path with constructor syntax.

anaconda3\lib\site-packages\pyzbar\ conatins both .dll (libiconv and libzbar-64). I have tried

`os.add_dll_directory(r"C:\Users\xxxxx\anaconda3\lib\site-packages\pyzbar")

`
But it does not solve the issue.

Can you help me please?

Best regards, giacomo

@lucenelletenebre
Copy link

I had the same issue, till I read all the README and then I found:

Windows error message
If you see an ugly ImportError when importing pyzbar on Windows you will most likely need the Visual C++ Redistributable Packages for Visual Studio 2013. Install vcredist_x64.exe if using 64-bit Python, vcredist_x86.exe if using 32-bit Python.

Installing vcredist_x64.exe solved the issue for me.

@GadgetSteve
Copy link

For others finding this the link (for me at the moment) for the redistributables is https://www.microsoft.com/en-gb/download/details.aspx?id=40784

@gutierrezps
Copy link

For others finding this the link (for me at the moment) for the redistributables is https://www.microsoft.com/en-gb/download/details.aspx?id=40784

It was already installed on my system. I was getting the same error when installing from conda (conda install -c conda-forge pyzbar). What solved for me was to uninstall the conda package (conda remove -c conda-forge pyzbar) and install pyzbar through pip (pip install pyzbar).

Since using pip inside a conda env is not recommended, I grabbed the DLL files (libiconv.dll and libzbar-64.dll) from the pip installation, uninstalled the pip package (pip uninstall pyzbar), installed pyzbar again from conda-forge, and pasted the DLL files into the folder shown in the error message.

That said, how can those DLL files be included in the conda-forge installation?

@khAja13
Copy link

khAja13 commented Feb 10, 2022

I had the same issue, till I read all the README and then I found:

Windows error message
If you see an ugly ImportError when importing pyzbar on Windows you will most likely need the Visual C++ Redistributable Packages for Visual Studio 2013. Install vcredist_x64.exe if using 64-bit Python, vcredist_x86.exe if using 32-bit Python.

Installing vcredist_x64.exe solved the issue for me.

Thanks mate, it solved me.

@nlhnt
Copy link

nlhnt commented Feb 16, 2022

This doesn't seem to be the case always.
I installed the package from pypi and then it worked... I have vcredist installed and it still gave the error.
Conda allows one to resolve such dependencies (as opposed to pypi) so maybe this could use some investigation?

What I mean it is kind of bizzare to see pypi version work and the conda one not (usually it is the other way around).

@reyniel26
Copy link

vcredist_x64.exe if using 64-bit Python

This help me a lot

@flavves
Copy link

flavves commented Apr 21, 2022

For others finding this the link (for me at the moment) for the redistributables is https://www.microsoft.com/en-gb/download/details.aspx?id=40784

thats work

@emingunes1
Copy link

For others finding this the link (for me at the moment) for the redistributables is https://www.microsoft.com/en-gb/download/details.aspx?id=40784

It was already installed on my system. I was getting the same error when installing from conda (conda install -c conda-forge pyzbar). What solved for me was to uninstall the conda package (conda remove -c conda-forge pyzbar) and install pyzbar through pip (pip install pyzbar).

Since using pip inside a conda env is not recommended, I grabbed the DLL files (libiconv.dll and libzbar-64.dll) from the pip installation, uninstalled the pip package (pip uninstall pyzbar), installed pyzbar again from conda-forge, and pasted the DLL files into the folder shown in the error message.

That said, how can those DLL files be included in the conda-forge installation?

I spent hours to solving the problem and this worked. Thanks a lot. However, the interesting thing is why these files were not downloaded when installation with conda

@Stoney256
Copy link

vcredist_x64.exe method worked for me

@rrizwan98
Copy link

rrizwan98 commented Apr 18, 2023

if you've already installed the pyzbr library, first uninstall (pip uninstall pyzbar) & then download the vcredist_x64.exe and install it

@sour-lollipop
Copy link

метод установки файла vcredist_x64.exe сработал у меня. Спасибо

@MeravYitzchak
Copy link

i get this error and fix it with https://www.microsoft.com/en-gb/download/details.aspx?id=40784 but uninstall pyzbar before!! if not do uninstall, its not work

@vinoj20
Copy link

vinoj20 commented Jul 7, 2023

yes its works man, thanks buddy
"If you have this error download and install ms visual C++ 2013 "

I had the same issue, till I read all the README and then I found:

Windows error message
If you see an ugly ImportError when importing pyzbar on Windows you will most likely need the Visual C++ Redistributable Packages for Visual Studio 2013. Install vcredist_x64.exe if using 64-bit Python, vcredist_x86.exe if using 32-bit Python.

Installing vcredist_x64.exe solved the issue for me.

@GitHubHun
Copy link

完美解决了
89822D38AB234E4A2EC1836C3E79B89E

@tieubaoboo
Copy link

thankkkk

@niksbanna
Copy link

niksbanna commented May 10, 2024

downloading this solved my issue.
https://www.microsoft.com/en-US/download/details.aspx?id=40784

@SevaShpun
Copy link

For others finding this the link (for me at the moment) for the redistributables is https://www.microsoft.com/en-gb/download/details.aspx?id=40784

Thanks bro! ♥

@itsabdullah15
Copy link

My issue is also solved by installing vcredist_x64.exe this, Thank you :)

@MarcSue28
Copy link

x64 12.0.40664 Microsoft.VCRedist.2013.x64 try to install this specific version https://gist.github.com/ChuckMichael/7366c38f27e524add3c54f710678c98b

@Trongen666
Copy link

Thank you kind sir

@Gnanigit
Copy link

Gnanigit commented Jan 1, 2025

I had the same issue, till I read all the README and then I found:

Windows error message
If you see an ugly ImportError when importing pyzbar on Windows you will most likely need the Visual C++ Redistributable Packages for Visual Studio 2013. Install vcredist_x64.exe if using 64-bit Python, vcredist_x86.exe if using 32-bit Python.

Installing vcredist_x64.exe solved the issue for me.

Thank you, my issue is solved.

@lucianocardoso21
Copy link

Try to install the AIO version of visual c++ redist AIO VERSION (like this one disponible in https://www.techpowerup.com/download/visual-c-redistributable-runtime-package-all-in-one/)

@dongyihua543
Copy link

if you've already installed the pyzbr library, first uninstall (pip uninstall pyzbar) & then download the vcredist_x64.exe and install it

完美解决,thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests