MacPorts – Problem installing py26-pyusb
I was trying to install the pyusb package on my MacBook Pro. I have MacPorts installed and there is an available port. But when I tried to install py26-pyusb, I received the following error:
---> Building py26-pyusb
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_python_py26-pyusb/work/pyusb-0.4.2" && /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6 setup.py --no-user-cfg build " returned error 1
Command output: pyusb.c:1750: warning: implicit declaration of function 'usb_get_string'
pyusb.c:1750: error: 'Py_usb_DeviceHandle' has no member named 'deviceHandle'
pyusb.c: In function 'Py_usb_DeviceHandle_getDescriptor':
pyusb.c:1811: warning: implicit declaration of function 'usb_get_descriptor'
pyusb.c:1811: error: 'Py_usb_DeviceHandle' has no member named 'deviceHandle'
pyusb.c:1813: warning: implicit declaration of function 'usb_get_descriptor_by_endpoint'
pyusb.c:1813: error: 'Py_usb_DeviceHandle' has no member named 'deviceHandle'
pyusb.c: In function 'Py_usb_DeviceHandle_del':
pyusb.c:1988: error: 'Py_usb_DeviceHandle' has no member named 'deviceHandle'
pyusb.c:1991: error: 'Py_usb_DeviceHandle' has no member named 'interfaceClaimed'
pyusb.c:1992: error: 'Py_usb_DeviceHandle' has no member named 'deviceHandle'
pyusb.c:1993: error: 'Py_usb_DeviceHandle' has no member named 'interfaceClaimed'
pyusb.c:1996: warning: implicit declaration of function 'usb_close'
pyusb.c:1996: error: 'Py_usb_DeviceHandle' has no member named 'deviceHandle'
pyusb.c: In function 'new_DeviceHandle':
pyusb.c:2062: warning: implicit declaration of function 'usb_open'
pyusb.c:2062: warning: assignment makes pointer from integer without a cast
pyusb.c:2070: error: 'Py_usb_DeviceHandle' has no member named 'deviceHandle'
pyusb.c:2071: error: 'Py_usb_DeviceHandle' has no member named 'interfaceClaimed'
pyusb.c: In function 'busses':
pyusb.c:2090: warning: implicit declaration of function 'usb_find_busses'
pyusb.c:2095: warning: implicit declaration of function 'usb_find_devices'
pyusb.c:2100: warning: implicit declaration of function 'usb_get_busses'
pyusb.c:2100: warning: assignment makes pointer from integer without a cast
pyusb.c:2107: error: dereferencing pointer to incomplete type
pyusb.c:2111: error: dereferencing pointer to incomplete type
pyusb.c:2112: warning: passing argument 1 of 'new_Bus' from incompatible pointer type
pyusb.c: In function 'initusb':
pyusb.c:2172: warning: implicit declaration of function 'usb_init'
error: command '/usr/bin/gcc-4.2' failed with exit status 1
Error: Status 1 encountered during processing.
Tracked the problem down to a minor bug in the setup.py file that is used during the build process. On my Mac this was located in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_python_py26-pyusb/work/pyusb-0.4.2. Here was the problem area:
elif -1 != platform.find("darwin"):
extra_link_args = ['-framework',
'CoreFoundation',
'-framework',
'IOKit',
'-L/sw/lib',
'-L/usr/local/lib']
extra_compile_args = ['-I/sw/include','-I/usr/local/lib']
This line:
extra_compile_args = ['-I/sw/include','-I/usr/local/lib']
should read
extra_compile_args = ['-I/opt/local/include','-I/usr/local/lib']
.
Triathlon Training, day 73
Today just had a field test at the track. I didn’t get to go do this until after work, after the farmer’s market, so it was dark and COLD at the Atascocita High School track. I’m not complaining, at least the gate wasn’t locked!
Just had to warm up for 1200 m and then run for 8 minutes and record everything. All went well except that I’ve just replaced my old Garmin FR 305 with a 310XT and I didn’t realize that one of the training options (autolap each mile) was enabled by default. So what was supposed to be lap 2 (the 8 minute run) is actually lap 2 and 3, with a pause in between them caused by me looking at the darn thing to figure out what was going on.
OK, keeping all that in mind, here is the data I was supposed to record:
Heart Rate (max): 160 b/m
Heart Rate (avg): 156 b/m
Duration: 06:53 (was supposed to be 8 minutes, see above)
Distance: 1.00 mi
Temperature: about 40 degrees F
Fatigue: Not sure what to put for this. Felt OK.