It’s something I need to remember: how do I install an old PyUSB package on Xubuntu (or a similar Debian-based OS). Why, you ask? Because I need that old version 0.4.3 for the little script that reads the solar energy numbers from the SMA Sunny Beam.

The SMA Sunny Beam monitor for our solar panel installation
Luckily, it isn’t too hard to do. This is my context:
- I am using Python 2.7
- I’m not certain the 0.4.3 version is compatible with newer versions of Python
- You need a copy of the relevant archive file called ‘
pyusb_0.4.3.orig.tar.gz
‘ (which you can find here: http://ftp.ubuntu.com/ubuntu/ubuntu/pool/universe/p/pyusb/)
Step one is to make sure you have the required header files to compile the PyUSB package. So you open up a terminal session and execute
sudo apt-get install libusb-dev sudo apt-get install python-dev
Step two: Extract the root folder and all the files from the PyUSB archive, and make that folder your current directory in the terminal session.
Step three: compile and install the package with this command:
sudo python setup.py install
That’s it. When all goes well, you’ll be able to verify the existence of two new files on your system, in a directory called “/usr/local/lib/python2.7/dist-packages
“:
usb.so pyusb-0.4.3.egg-info
Done!