Compiling modules in OSX, eg PyUSB?

Philip Semanchuk philip at
Sat Mar 21 14:34:55 CET 2009

On Mar 21, 2009, at 2:49 AM, Dr Mephesto wrote:

> On Mar 20, 6:23 pm, Philip Semanchuk <phi... at> wrote:
>> So change line 32 in the PyUSB from this:
>>      extra_compile_args = ['-I/sw/include']
>> to this:
>>      extra_compile_args = ['-I/sw/include', '-I/usr/local/include']
>> The same assumption is made about the linker path. Note the '-L/sw/
>> lib'. You'll need to track down your copy of libusb (it's probably  
>> in /
>> usr/local/lib) and add that to the extra_link_args like so:
>>      extra_link_args = ['-framework',
>>                         'CoreFoundation',
>>                         '-framework',
>>                         'IOKit',
>>                         '-L/sw/lib',
>>                         '-L/usr/local/lib']
>> Run setup again and I bet you'll be off to the races.
>> You should certainly report this to the package maintainer, and you
>> might also want to point out that the if block starting on line 17 of
>> and the if block starting on line 26 are both for OS X, but
>> they lead to different results!
>> Let us know how it works out,
>> Philip
> Great, that did the job perfectly! Very much appreciated!
> I will write to the code maintainer to let them know the fix; I'm sure
> their are lots of other people out there that will find your
> modification useful.

You're welcome. Glad I could help.


More information about the Python-list mailing list