imageprocessing icon indicating copy to clipboard operation
imageprocessing copied to clipboard

Problem running the testing installation snippet

Open JoseVillanuevaMolina opened this issue 4 years ago • 8 comments

Hello I got an error after running the testing installation snippet. Any idea?

OSError Traceback (most recent call last) ~\anaconda3\envs\micasense\lib\site-packages\pyzbar\zbar_library.py in load() 57 try: ---> 58 dependencies, libzbar = load_objects(Path('')) 59 except OSError:

~\anaconda3\envs\micasense\lib\site-packages\pyzbar\zbar_library.py in load_objects(directory) 53 ] ---> 54 libzbar = cdll.LoadLibrary(str(directory.joinpath(fname))) 55 return deps, libzbar

~\anaconda3\envs\micasense\lib\ctypes_init_.py in LoadLibrary(self, name) 441 def LoadLibrary(self, name): --> 442 return self._dlltype(name) 443

~\anaconda3\envs\micasense\lib\ctypes_init_.py in init(self, name, mode, handle, use_errno, use_last_error) 363 if handle is None: --> 364 self._handle = _dlopen(self._name, mode) 365 else:

OSError: [WinError 126] No se puede encontrar el módulo especificado

During handling of the above exception, another exception occurred:

OSError Traceback (most recent call last) in 3 import os, glob 4 import numpy as np ----> 5 import pyzbar.pyzbar as pyzbar 6 import matplotlib.pyplot as plt 7 import mapboxgl

~\anaconda3\envs\micasense\lib\site-packages\pyzbar\pyzbar.py in 5 from .locations import bounding_box, convex_hull, Point, Rect 6 from .pyzbar_error import PyZbarError ----> 7 from .wrapper import ( 8 zbar_image_scanner_set_config, 9 zbar_image_scanner_create, zbar_image_scanner_destroy,

~\anaconda3\envs\micasense\lib\site-packages\pyzbar\wrapper.py in 141 c_int, 142 c_uint_p, # major, --> 143 c_uint_p, # minor 144 ) 145

~\anaconda3\envs\micasense\lib\site-packages\pyzbar\wrapper.py in zbar_function(fname, restype, *args) 134 """ 135 prototype = CFUNCTYPE(restype, *args) --> 136 return prototype((fname, load_libzbar())) 137 138

~\anaconda3\envs\micasense\lib\site-packages\pyzbar\wrapper.py in load_libzbar() 113 global EXTERNAL_DEPENDENCIES 114 if not LIBZBAR: --> 115 libzbar, dependencies = zbar_library.load() 116 LIBZBAR = libzbar 117 EXTERNAL_DEPENDENCIES = [LIBZBAR] + dependencies

~\anaconda3\envs\micasense\lib\site-packages\pyzbar\zbar_library.py in load() 58 dependencies, libzbar = load_objects(Path('')) 59 except OSError: ---> 60 dependencies, libzbar = load_objects(Path(file).parent) 61 else: 62 # Assume a shared library on the path

~\anaconda3\envs\micasense\lib\site-packages\pyzbar\zbar_library.py in load_objects(directory) 52 for dep in dependencies 53 ] ---> 54 libzbar = cdll.LoadLibrary(str(directory.joinpath(fname))) 55 return deps, libzbar 56

~\anaconda3\envs\micasense\lib\ctypes_init_.py in LoadLibrary(self, name) 440 441 def LoadLibrary(self, name): --> 442 return self._dlltype(name) 443 444 cdll = LibraryLoader(CDLL)

~\anaconda3\envs\micasense\lib\ctypes_init_.py in init(self, name, mode, handle, use_errno, use_last_error) 362 363 if handle is None: --> 364 self._handle = _dlopen(self._name, mode) 365 else: 366 self._handle = handle

OSError: [WinError 126] No se puede encontrar el módulo especificado

JoseVillanuevaMolina avatar Nov 18 '20 20:11 JoseVillanuevaMolina

If I comment the code #import pyzbar.pyzbar as pyzbar, the error disappears. Captura

JoseVillanuevaMolina avatar Nov 18 '20 21:11 JoseVillanuevaMolina

Seems like the libzbar library isn't properly installed.

What OS? What actions have you taken? Were there any errors during those actions?

poynting avatar Nov 18 '20 21:11 poynting

Also, check the pyzbar page, there is information there such as: image

poynting avatar Nov 18 '20 21:11 poynting

My OS is Windows 10. I downloaded the environment and ran the setup test code.

JoseVillanuevaMolina avatar Nov 23 '20 16:11 JoseVillanuevaMolina

One dep is missing in the conda requirements.

https://anaconda.org/conda-forge/zbar

philipperemy avatar Nov 14 '21 01:11 philipperemy

You can either install it at the OS level or in conda.

conda install -c conda-forge pyzbar

philipperemy avatar Nov 14 '21 02:11 philipperemy

It's been a while, but last time I tried it didn't work across all platforms from conda.

If someone wants to test it on Win/Linux/Mac and make a PR, I'll merge it.

On Sat, Nov 13, 2021, 6:01 PM Philippe Rémy @.***> wrote:

You can either install it at the OS level or in conda.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/micasense/imageprocessing/issues/130#issuecomment-968190700, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSNZUYQCOBFLHOJYYS4HOLUL4KATANCNFSM4T2PBV3A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

poynting avatar Nov 14 '21 02:11 poynting

Yes, I understand the idea. The last time I tested doing it that way, it did not work. I don't recall the specific issue, but I believe it was on Mac or Linux where it failed.

If someone will confirm that it does work now across platforms, and update the notebooks and documentation, I will be happy to merge the PR. Otherwise it will need to wait until I have some time in the office to validate across platforms.

On Sun, Nov 14, 2021, 1:23 AM Philippe Rémy @.***> wrote:

@poynting https://github.com/poynting I guess you can make it work for everyone in the easiest way, I guess you can add it as a dep to conda (rather than relying on a manual installation such as brew).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/micasense/imageprocessing/issues/130#issuecomment-968254644, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSNZUYFG5QVSRPQX4LGSBTUL55XHANCNFSM4T2PBV3A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

poynting avatar Nov 14 '21 17:11 poynting