Compiling modules in OSX, eg PyUSB?

Philip Semanchuk philip at semanchuk.com
Fri Mar 20 12:04:23 EDT 2009


On Mar 20, 2009, at 11:39 AM, Dr Mephesto wrote:

> Thanks.
>
> I found some more info that might help, if I understood it :)From the
> main PyUSB page, at http://pyusb.berlios.de/ , its says:
>
> "PyUSB uses the libusb to do its work, so, any system which has Python
> and libusb should work for PyUSB."

OK, great -- that moves your problem from PyUSB to libusb, which is  
useful to know. The PyUSB page lists supported operating systems only  
as "Linux" which is partly what threw me off.


> I have installed the OSX version of libusb, and it puts the missing
> file "usb.h" in the directory: usr/local/include/usb.h
> In the instruction for installing PyUSB on windows, it says:
>
> "2) libusb-win32: a Windows version of the libusb C library available
> from http://libusb-win32.sourceforge.net.
>> From within a Cygwin terminal, copy the libusb.a file from the
> libusb-win32 lib/ directory to $(CYGWINDIR)/usr/lib/, and copy the
> usb.h file from the libusb-win32 include/ directory to
> $(CYGWINDIR)/usr/include/.  You can build and install PyUSB with the
> command:   python setup.py install"

Whoa, why are we discussing Windows all of a sudden?


> As I have the required usb.h file, is there some way to let the
> compiler know where is it when I run python setup.py install? I
> already tried copying the "usb.h" file from usr/local/include/ to / 
> usr/
> iinclude, but it still didnt find it.

You don't have to do anything special to get the Python compile step  
to look in /usr/include or /usr/local/include.

Can you post the output from this command?
find /usr -name usb.h -ls

Also post the output you get when you run this for PyUSB:
sudo python setup.py install










More information about the Python-list mailing list