Last Updated: February 25, 2016
·
466
· guerre50

AlternateSetting error in python-ant

If you get error "Interface" object has not attribute AlternateSetting when using USB2Driver of python-ant you can fix it modifying line 198 in file drivers.py located in:

/usr/local/lib/python2.7/dist-packages/ant-develop-py2.7.egg/ant/core/driver.py

from:

AlternateSetting = alternateSetting

to:

bAlternateSetting = alternateSetting

It seems that installing the library using python setup.py install uses an old version of the library with bugs. The related fix is in GitHub: https://github.com/tomwardill/python-ant/commit/c1bea8fb6818aa983edea7576a8cbb06c41a9cce