Happened to come across the solution to this. Simply build libusb with ./configure CC="gcc -m32" make sudo make install
Then install pyusb. On Thu, May 6, 2010 at 11:10 AM, Wander Lairson <wander.lair...@gmail.com> wrote: > I guess it is a libusb build issue. Try to build and run any of the libusb > samples. > > 2010/5/6 Mike Lawrence <mike.lawre...@dal.ca> >> >> See below for the debug trace. Looks like it finds libusb-1.0, but >> claims that it was built using the wrong architecture. When installing >> libusb-1.0, I downloaded the source then ran >> ./configure;make;sudo make install >> as usuall, and didn't see any significant errors. Below the pyusb >> debug trace, I'll paste the log produced when I install libusb-1.0... >> >> ######## >> # PyUSB debug trace >> ######## >> 2010-05-06 08:13:16,588 ERROR:usb.backend.libusb10:Error loading >> libusb 1.0 backend >> Traceback (most recent call last): >> File >> "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/usb/backend/libusb10.py", >> line 588, in get_backend >> _lib = _load_library() >> File >> "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/usb/backend/libusb10.py", >> line 165, in _load_library >> l = CDLL(libname) >> File >> "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ctypes/__init__.py", >> line 353, in __init__ >> self._handle = _dlopen(self._name, mode) >> OSError: dlopen(/usr/local/lib/libusb-1.0.dylib, 6): no suitable image >> found. Did find: >> /usr/local/lib/libusb-1.0.dylib: mach-o, but wrong architecture >> 2010-05-06 08:13:16,690 ERROR:usb.backend.openusb:Error loading OpenUSB >> backend >> Traceback (most recent call last): >> File >> "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/usb/backend/openusb.py", >> line 588, in get_backend >> _lib = _load_library() >> File >> "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/usb/backend/openusb.py", >> line 149, in _load_library >> raise OSError('USB library could not be found') >> OSError: USB library could not be found >> 2010-05-06 08:13:16,693 ERROR:usb.backend.libusb01:Error loading >> libusb 0.1 backend >> Traceback (most recent call last): >> File >> "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/usb/backend/libusb01.py", >> line 539, in get_backend >> _lib = _load_library() >> File >> "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/usb/backend/libusb01.py", >> line 180, in _load_library >> raise OSError('USB library could not be found') >> OSError: USB library could not be found >> Traceback (most recent call last): >> File "<stdin>", line 1, in <module> >> File >> "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/usb/legacy.py", >> line 326, in busses >> return (Bus(),) >> File >> "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/usb/legacy.py", >> line 322, in __init__ >> self.devices = [Device(d) for d in core.find(find_all=True)] >> File >> "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/usb/core.py", >> line 819, in find >> raise ValueError('No backend available') >> ValueError: No backend available >> >> >> ######## >> # libusb-1.0 install log >> ######## >> >> mal:libusb-1.0.8 mike$ ./configure >> checking for a BSD-compatible install... /usr/bin/install -c >> checking whether build environment is sane... yes >> checking for a thread-safe mkdir -p... ./install-sh -c -d >> checking for gawk... no >> checking for mawk... no >> checking for nawk... no >> checking for awk... awk >> checking whether make sets $(MAKE)... yes >> checking for gcc... gcc >> checking whether the C compiler works... yes >> checking for C compiler default output file name... a.out >> checking for suffix of executables... >> checking whether we are cross compiling... no >> checking for suffix of object files... o >> checking whether we are using the GNU C compiler... yes >> checking whether gcc accepts -g... yes >> checking for gcc option to accept ISO C89... none needed >> checking for style of include used by make... GNU >> checking dependency style of gcc... gcc3 >> checking build system type... i386-apple-darwin10.3.0 >> checking host system type... i386-apple-darwin10.3.0 >> checking for a sed that does not truncate output... /usr/bin/sed >> checking for grep that handles long lines and -e... /usr/bin/grep >> checking for egrep... /usr/bin/grep -E >> checking for fgrep... /usr/bin/grep -F >> checking for ld used by gcc... >> /usr/libexec/gcc/i686-apple-darwin10/4.2.1/ld >> checking if the linker (/usr/libexec/gcc/i686-apple-darwin10/4.2.1/ld) >> is GNU ld... no >> checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm >> checking the name lister (/usr/bin/nm) interface... BSD nm >> checking whether ln -s works... yes >> checking the maximum length of command line arguments... 196608 >> checking whether the shell understands some XSI constructs... yes >> checking whether the shell understands "+="... yes >> checking for /usr/libexec/gcc/i686-apple-darwin10/4.2.1/ld option to >> reload object files... -r >> checking for objdump... no >> checking how to recognize dependent libraries... pass_all >> checking for ar... ar >> checking for strip... strip >> checking for ranlib... ranlib >> checking command to parse /usr/bin/nm output from gcc object... ok >> checking for dsymutil... dsymutil >> checking for nmedit... nmedit >> checking for lipo... lipo >> checking for otool... otool >> checking for otool64... no >> checking for -single_module linker flag... yes >> checking for -exported_symbols_list linker flag... yes >> checking how to run the C preprocessor... gcc -E >> checking for ANSI C header files... yes >> checking for sys/types.h... yes >> checking for sys/stat.h... yes >> checking for stdlib.h... yes >> checking for string.h... yes >> checking for memory.h... yes >> checking for strings.h... yes >> checking for inttypes.h... yes >> checking for stdint.h... yes >> checking for unistd.h... yes >> checking for dlfcn.h... yes >> checking for objdir... .libs >> checking if gcc supports -fno-rtti -fno-exceptions... no >> checking for gcc option to produce PIC... -fno-common -DPIC >> checking if gcc PIC flag -fno-common -DPIC works... yes >> checking if gcc static flag -static works... no >> checking if gcc supports -c -o file.o... yes >> checking if gcc supports -c -o file.o... (cached) yes >> checking whether the gcc linker >> (/usr/libexec/gcc/i686-apple-darwin10/4.2.1/ld) supports shared >> libraries... yes >> checking dynamic linker characteristics... darwin10.3.0 dyld >> checking how to hardcode library paths into programs... immediate >> checking whether stripping libraries is possible... yes >> checking if libtool supports shared libraries... yes >> checking whether to build shared libraries... yes >> checking whether to build static libraries... yes >> checking for inline... inline >> checking whether gcc and cc understand -c and -o together... yes >> checking operating system... Darwin/MacOS X >> checking sys/timerfd.h usability... no >> checking sys/timerfd.h presence... no >> checking for sys/timerfd.h... no >> checking whether TFD_NONBLOCK is declared... no >> checking whether to use timerfd for timing... no (header not available) >> configure: creating ./config.status >> config.status: creating libusb-1.0.pc >> config.status: creating Makefile >> config.status: creating libusb/Makefile >> config.status: creating examples/Makefile >> config.status: creating doc/Makefile >> config.status: creating doc/doxygen.cfg >> config.status: creating config.h >> config.status: executing depfiles commands >> config.status: executing libtool commands >> >> >> mal:libusb-1.0.8 mike$ make >> make all-recursive >> Making all in libusb >> CC libusb_1_0_la-core.lo >> CC libusb_1_0_la-descriptor.lo >> CC libusb_1_0_la-io.lo >> io.c:1674: warning: ‘handle_timeout’ defined but not used >> io.c:1688: warning: ‘handle_timeouts_locked’ defined but not used >> CC libusb_1_0_la-sync.lo >> CC libusb_1_0_la-darwin_usb.lo >> os/darwin_usb.c: In function ‘event_thread_main’: >> os/darwin_usb.c:286: warning: cast to pointer from integer of different >> size >> CCLD libusb-1.0.la >> Making all in doc >> make[2]: Nothing to be done for `all'. >> make[2]: Nothing to be done for `all-am'. >> >> >> mal:libusb-1.0.8 mike$ sudo make install >> Password: >> Making install in libusb >> test -z "/usr/local/lib" || .././install-sh -c -d "/usr/local/lib" >> /bin/sh ../libtool --mode=install /usr/bin/install -c >> libusb-1.0.la '/usr/local/lib' >> libtool: install: /usr/bin/install -c .libs/libusb-1.0.0.dylib >> /usr/local/lib/libusb-1.0.0.dylib >> libtool: install: (cd /usr/local/lib && { ln -s -f libusb-1.0.0.dylib >> libusb-1.0.dylib || { rm -f libusb-1.0.dylib && ln -s >> libusb-1.0.0.dylib libusb-1.0.dylib; }; }) >> libtool: install: /usr/bin/install -c .libs/libusb-1.0.lai >> /usr/local/lib/libusb-1.0.la >> libtool: install: /usr/bin/install -c .libs/libusb-1.0.a >> /usr/local/lib/libusb-1.0.a >> libtool: install: chmod 644 /usr/local/lib/libusb-1.0.a >> libtool: install: ranlib /usr/local/lib/libusb-1.0.a >> ---------------------------------------------------------------------- >> Libraries have been installed in: >> /usr/local/lib >> >> If you ever happen to want to link against installed libraries >> in a given directory, LIBDIR, you must either use libtool, and >> specify the full pathname of the library, or use the `-LLIBDIR' >> flag during linking and do at least one of the following: >> - add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable >> during execution >> >> See any operating system documentation about shared libraries for >> more information, such as the ld(1) and ld.so(8) manual pages. >> ---------------------------------------------------------------------- >> test -z "/usr/local/include/libusb-1.0" || .././install-sh -c -d >> "/usr/local/include/libusb-1.0" >> /usr/bin/install -c -m 644 libusb.h '/usr/local/include/libusb-1.0' >> Making install in doc >> make[2]: Nothing to be done for `install-exec-am'. >> make[2]: Nothing to be done for `install-data-am'. >> make[2]: Nothing to be done for `install-exec-am'. >> test -z "/usr/local/lib/pkgconfig" || ./install-sh -c -d >> "/usr/local/lib/pkgconfig" >> /usr/bin/install -c -m 644 libusb-1.0.pc '/usr/local/lib/pkgconfig' >> >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> pyusb-users mailing list >> pyusb-users@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/pyusb-users > > > ------------------------------------------------------------------------------ > > _______________________________________________ > pyusb-users mailing list > pyusb-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/pyusb-users > > ------------------------------------------------------------------------------ Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar _______________________________________________ pyusb-users mailing list pyusb-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pyusb-users