-
Notifications
You must be signed in to change notification settings - Fork 181
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 'libiconv.dll' (or one of its dependencies). Try using the full path with constructor syntax.` #161
Comments
I just followed stackoverflow and solved it on my computer
|
I just followed stackoverflow and solved it on my computer down pyzbar-0.1.9-py2.py3-none-win_amd64.whl in https://pypi.org/project/pyzbar/#files |
I install Visual C++ Redistributable Packages for Visual Studio 2013 and solved it on my computer |
I install Visual C++ Redistributable Packages for Visual Studio 2013 and solved it on my computer |
Note: Try to install the AIO version (like this one disponible in https://www.techpowerup.com/download/visual-c-redistributable-runtime-package-all-in-one/) |
CHECK THE BOLD MESSAGES
I don't know if this is a common prob to everyone and if this will be the longest Issue ever but I'll try to make it short but still providing the error and the codes:
The Error:
Traceback (most recent call last): File "d:\OneDrive - De La Salle Santiago Zobel School, Inc\Desktop\FLL\app.py", line 3, in <module> from pyzbar.pyzbar import decode File "C:\Users\zande\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyzbar\pyzbar.py", line 7, in <module> from .wrapper import ( File "C:\Users\zande\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyzbar\wrapper.py", line 151, in <module> zbar_version = zbar_function( File "C:\Users\zande\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyzbar\wrapper.py", line 148, in zbar_function return prototype((fname, load_libzbar())) File "C:\Users\zande\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyzbar\wrapper.py", line 127, in load_libzbar libzbar, dependencies = zbar_library.load() File "C:\Users\zande\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyzbar\zbar_library.py", line 61, in load dependencies, libzbar = load_objects(dll_path.parent) File "C:\Users\zande\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyzbar\zbar_library.py", line 50, in load_objects deps = [ File "C:\Users\zande\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyzbar\zbar_library.py", line 51, in <listcomp> cdll.LoadLibrary(str(directory.joinpath(dep))) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\ctypes\__init__.py", line 452, in LoadLibrary return self._dlltype(name) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\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.
It's literally told there that the problem is libiconv.dll. I will not show my project because it's literally obvious what the problem was. And yes, the file is not in the incorrect path nor corrupted.
This is the unedited code code from zbar_library.py:
`"""Loads zbar and its dependencies.
"""
import platform
import sys
from ctypes import cdll
from ctypes.util import find_library
from pathlib import Path
all = ['load']
def _windows_fnames():
"""For convenience during development and to aid debugging, the DLL names
are specific to the bit depth of interpreter.
def load():
"""Loads the libzar shared library and its dependencies.
"""
if 'Windows' == platform.system():
# Possible scenarios here
# 1. Run from source, DLLs are in pyzbar directory
# cdll.LoadLibrary() imports DLLs in repo root directory
# 2. Wheel install into CPython installation
# cdll.LoadLibrary() imports DLLs in package directory
# 3. Wheel install into virtualenv
# cdll.LoadLibrary() imports DLLs in package directory
# 4. Frozen
# cdll.LoadLibrary() imports DLLs alongside executable
fname, dependencies = _windows_fnames()
And this is what I edited in the code:
`"""Loads zbar and its dependencies.
"""
import platform
import sys
from ctypes import cdll
from ctypes.util import find_library
from pathlib import Path
all = ['load']
def _windows_fnames():
"""For convenience during development and to aid debugging, the DLL names
are specific to the bit depth of interpreter.
def load():
"""Loads the libzar shared library and its dependencies.
"""
if 'Windows' == platform.system():
# Possible scenarios here
# 1. Run from source, DLLs are in pyzbar directory
# cdll.LoadLibrary() imports DLLs in repo root directory
# 2. Wheel install into CPython installation
# cdll.LoadLibrary() imports DLLs in package directory
# 3. Wheel install into virtualenv
# cdll.LoadLibrary() imports DLLs in package directory
# 4. Frozen
# cdll.LoadLibrary() imports DLLs alongside executable
fname, dependencies = _windows_fnames()
`
This is what error I got now from editing line 59 and 61:
Traceback (most recent call last):
File "d:\OneDrive - De La Salle Santiago Zobel School, Inc\Desktop\FLL\app.py", line 3, in
from pyzbar.pyzbar import decode
File "C:\Users\zande\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyzbar\pyzbar.py", line 7, in
from .wrapper import (
File "C:\Users\zande\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyzbar\wrapper.py", line 151, in
zbar_version = zbar_function(
File "C:\Users\zande\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyzbar\wrapper.py", line 148, in zbar_function
return prototype((fname, load_libzbar()))
File "C:\Users\zande\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyzbar\wrapper.py", line 127, in load_libzbar
libzbar, dependencies = zbar_library.load()
File "C:\Users\zande\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyzbar\zbar_library.py", line 61, in load
dependencies, libzbar = load_objects(dll_path.parent)
File "C:\Users\zande\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyzbar\zbar_library.py", line 50, in load_objects
deps = [
File "C:\Users\zande\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyzbar\zbar_library.py", line 51, in
cdll.LoadLibrary(str(directory.joinpath(dep)))
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\ctypes_init_.py", line 452, in LoadLibrary
return self.dlltype(name)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\ctypes_init.py", line 374, in init
self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'C:\Users\zande\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyzbar\libiconv.dll' (or one of its dependencies). Try using the full path with constructor syntax.
Almost the same but I change the code with the constructor syntax now. I have been researching from here in github, in other websites, and still didn't find anything to fix this. Can someone from the devs help me here?
The text was updated successfully, but these errors were encountered: