From: Mathieu C. <mat...@gm...> - 2013-03-09 14:16:32
|
Le 9/03/13 14:58, Wander Lairson Costa a écrit : > 2013/3/9 Mathieu Carette <mat...@gm...>: >> Hello, >> >> I am trying to get pyusb working on OSX 10.8 with Python 2.7 (my goal is >> to be able to communicate with a novation nocturn using python, see >> https://github.com/dewert/nocturn-linux-midi which relies on pyusb.) >> >> I installed libusb 1.0 through macports >> >> $ port installed libusb -v >> The following ports are currently installed: >> libusb @1.0.9_0 (active) >> libusb @1.0.9_0+universal >> >> Now after installing pyusb (and setting PYUSB_DEBUG_LEVEL = debug), it >> seems pyusb cannot find any backend : >> >> >>> import usb >> >>> usb.core.find() >> 2013-03-09 10:28:47,635 ERROR:usb.backend.libusb1:Error loading libusb >> 1.0 backend >> Traceback (most recent call last): >> File "/Library/Python/2.7/site-packages/usb/backend/libusb1.py", line >> 655, in get_backend >> _lib = _load_library() >> File "/Library/Python/2.7/site-packages/usb/backend/libusb1.py", line >> 205, in _load_library >> raise OSError('USB library could not be found') >> OSError: USB library could not be found >> 2013-03-09 10:28:47,636 ERROR:usb.backend.openusb:Error loading OpenUSB >> backend >> Traceback (most recent call last): >> File "/Library/Python/2.7/site-packages/usb/backend/openusb.py", line >> 701, in get_backend >> _lib = _load_library() >> File "/Library/Python/2.7/site-packages/usb/backend/openusb.py", line >> 248, in _load_library >> raise OSError('USB library could not be found') >> OSError: USB library could not be found >> 2013-03-09 10:28:47,638 ERROR:usb.backend.libusb0:Error loading libusb >> 0.1 backend >> Traceback (most recent call last): >> File "/Library/Python/2.7/site-packages/usb/backend/libusb0.py", line >> 580, in get_backend >> _setup_prototypes(_lib) >> File "/Library/Python/2.7/site-packages/usb/backend/libusb0.py", line >> 208, in _setup_prototypes >> lib.usb_open.argtypes = [POINTER(_usb_device)] >> File >> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", >> line 366, in __getattr__ >> func = self.__getitem__(name) >> File >> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", >> line 371, in __getitem__ >> func = self._FuncPtr((name_or_ordinal, self)) >> AttributeError: dlsym(RTLD_DEFAULT, usb_open): symbol not found >> Traceback (most recent call last): >> File "<stdin>", line 1, in <module> >> File "/Library/Python/2.7/site-packages/usb/core.py", line 856, in find >> raise ValueError('No backend available') >> ValueError: No backend available >> >> >> >> Could anyone point me to the next thing to do in this case (I did search >> the mailing list and the internet, where similar issues where occuring, >> but I could not find an answer explicit enough for me to understand what >> to do: I am rather new to both OSX and Python) >> > After you install libusb, where does it reside? > > I changed nothing from the default macports behavior. I am not quite sure what to look for. The files libusb-1.0.0.dylib, libusb-1.0.a, libusb-1.0.la, ... which are located in /opt/local/lib/ Other than that, there are source files /opt/local/include/libusb-1.0/libusb.h /opt/local/var/macports/software/libusb/libusb-1.0.9_0.darwin_12.x86_64.tbz2 |