Getting ready

We will need to install pyusb for Python 3 using pip-3.2 as follows:

sudo pip-3.2 install pyusb  

You can test whether pyusb has installed correctly by running the following:

python3
> import usb
> help (usb)
> exit()  

This should allow you to view the package information, if it was installed correctly.

Get Raspberry Pi 3 Cookbook for Python Programmers - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.