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

OSError: [WinError 126] Cannot find the specified module. #13

Closed
Boyden opened this issue Feb 17, 2018 · 2 comments
Closed

OSError: [WinError 126] Cannot find the specified module. #13

Boyden opened this issue Feb 17, 2018 · 2 comments

Comments

@Boyden
Copy link

@Boyden Boyden commented Feb 17, 2018

I have successfully use the command pip install pyzbar and installed it, but when I type from pyzbar.pyzbar import decode, I get the following error:OSError: [WinError 126] Cannot find the specified module.

The whole info is as follows:

OSError Traceback (most recent call last)
c:\users\acer\appdata\local\programs\python\python36\lib\site-packages\pyzbar-0.1.4-py3.6.egg\pyzbar\wrapper.py in load_libzbar()
127 try:
--> 128 loaded_dependencies, libzbar = load(Path(''))
129 except OSError as e:

c:\users\acer\appdata\local\programs\python\python36\lib\site-packages\pyzbar-0.1.4-py3.6.egg\pyzbar\wrapper.py in load(dir)
121 cdll.LoadLibrary(str(dir.joinpath(dep)))
--> 122 for dep in dependencies
123 ]

c:\users\acer\appdata\local\programs\python\python36\lib\site-packages\pyzbar-0.1.4-py3.6.egg\pyzbar\wrapper.py in (.0)
121 cdll.LoadLibrary(str(dir.joinpath(dep)))
--> 122 for dep in dependencies
123 ]

c:\users\acer\appdata\local\programs\python\python36\lib\ctypes_init_.py in LoadLibrary(self, name)
425 def LoadLibrary(self, name):
--> 426 return self._dlltype(name)
427

c:\users\acer\appdata\local\programs\python\python36\lib\ctypes_init_.py in init(self, name, mode, handle, use_errno, use_last_error)
347 if handle is None:
--> 348 self._handle = _dlopen(self._name, mode)
349 else:

OSError: [WinError 126] 找不到指定的模块。

During handling of the above exception, another exception occurred:

OSError Traceback (most recent call last)
in ()
----> 1 from pyzbar.pyzbar import decode

c:\users\acer\appdata\local\programs\python\python36\lib\site-packages\pyzbar-0.1.4-py3.6.egg\pyzbar\pyzbar.py in ()
6
7 from .pyzbar_error import PyZbarError
----> 8 from .wrapper import (
9 zbar_image_scanner_set_config,
10 zbar_image_scanner_create, zbar_image_scanner_destroy,

c:\users\acer\appdata\local\programs\python\python36\lib\site-packages\pyzbar-0.1.4-py3.6.egg\pyzbar\wrapper.py in ()
164 c_int,
165 c_uint_p, # major,
--> 166 c_uint_p, # minor
167 )
168

c:\users\acer\appdata\local\programs\python\python36\lib\site-packages\pyzbar-0.1.4-py3.6.egg\pyzbar\wrapper.py in zbar_function(fname, restype, *args)
157 """
158 prototype = CFUNCTYPE(restype, *args)
--> 159 return prototype((fname, load_libzbar()))
160
161

c:\users\acer\appdata\local\programs\python\python36\lib\site-packages\pyzbar-0.1.4-py3.6.egg\pyzbar\wrapper.py in load_libzbar()
128 loaded_dependencies, libzbar = load(Path(''))
129 except OSError as e:
--> 130 loaded_dependencies, libzbar = load(Path(file).parent)
131 else:
132 # Assume a shared library on the path

c:\users\acer\appdata\local\programs\python\python36\lib\site-packages\pyzbar-0.1.4-py3.6.egg\pyzbar\wrapper.py in load(dir)
120 deps = [
121 cdll.LoadLibrary(str(dir.joinpath(dep)))
--> 122 for dep in dependencies
123 ]
124 libzbar = cdll.LoadLibrary(str(dir.joinpath(fname)))

c:\users\acer\appdata\local\programs\python\python36\lib\site-packages\pyzbar-0.1.4-py3.6.egg\pyzbar\wrapper.py in (.0)
120 deps = [
121 cdll.LoadLibrary(str(dir.joinpath(dep)))
--> 122 for dep in dependencies
123 ]
124 libzbar = cdll.LoadLibrary(str(dir.joinpath(fname)))

c:\users\acer\appdata\local\programs\python\python36\lib\ctypes_init_.py in LoadLibrary(self, name)
424
425 def LoadLibrary(self, name):
--> 426 return self._dlltype(name)
427
428 cdll = LibraryLoader(CDLL)

c:\users\acer\appdata\local\programs\python\python36\lib\ctypes_init_.py in init(self, name, mode, handle, use_errno, use_last_error)
346
347 if handle is None:
--> 348 self._handle = _dlopen(self._name, mode)
349 else:
350 self._handle = handle

OSError: [WinError 126] 找不到指定的模块。

@quicklizard99

This comment has been minimized.

Copy link
Member

@quicklizard99 quicklizard99 commented Mar 11, 2018

This is almost certainly because a runtime dependency of one of the DLLs (libzbar-64.dll or libiconv.dll on a 64-bit build of Python; libzbar-32.dll or libiconv-2.dll on a 32-bit build) was not found on your system. This will be hard to diagnose precisely without more information but I would guess that the expected Microsoft Visual C runtime DLL is missing from your system.

Could you install this from https://www.microsoft.com/en-US/download/details.aspx?id=40784 and try again?

@gkerekes

This comment has been minimized.

Copy link

@gkerekes gkerekes commented Jan 2, 2019

I had the same issue and @quicklizard99 suggestion worked for me

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.