The book uses a range of software packages to extend the capabilities of the pre-installed software.
In most cases, the latest version of the software available should be used (versions are listed just in case there is a compatibility issue in a later release). The list of software used is as follows:
- Notepad ++: www.notepad-plus-plus.org (Version 7.5.6)
- PuTTY: www.putty.org (Version 0.62)
- VNC Viewer: www.realvnc.com (Version 6.2.1)
- Xming: www.straightrunning.com/XmingNotes (Version 6.9.0.31 public domain release)
- MobaXterm: mobaxterm.mobatek.net (Version 8.6)
- SD Formatter: www.sdcard.org/downloads/formatter_4 (Version 5.0)
- RealTerm: realterm.sourceforge.net (Version 2.0.0.70)
This section lists each of the packages used in the chapters in the book in the following format (versions are listed just in case there is a compatibility issue in a later release):
- Package name (version)
Supporting website
:
Install command
- This chapter describes the hardware setup, and, therefore, the following packages are optional (or specific hardware drivers where necessary):
- TightVNC (Version 1.3.9-6.5): http://www.tightvnc.com
sudo apt-get install tightvncserver
- Samba (Version 2:4.2.10): https://www.samba.org
sudo apt-get install samba
Following are the commands used in Chapter 2, Dividing Text Data and Building Text Classifier:
sudo apt-get install geany sudo apt-get -y install python-pip sudo apt-get -y install python-git sudo apt-get -y install python-numpy sudo apt-get -y install python-scipy sudo pip install --upgrade cython sudo pip install -U scikit-learn sudo pip install imutils sudo apt-get -y install python-sklearn sudo apt-get -y install python-skimage
- Tkinter (Version 3.4.2-1): https://wiki.python.org/moin/TkInter
sudo apt-get install python3-tk
- pip-3.2 (Version 1.5.6-5): https://pip.pypa.io/en/latest
sudo apt-get install python3-pip
- libjpeg-dev (Version 1:1.3.1-12): http://libjpeg.sourceforge.net
sudo apt-get install libjpeg-dev
- Pillow (Version 2.1.0): http://pillow.readthedocs.io/en/latest
sudo pip-3.2 install pillow
Following are the commands used in Chapter 4, Predicting Sentiments in Words:
sudo apt-get install geany sudo apt-get -y install python-pip sudo apt-get -y install python-git sudo apt-get -y install python-numpy sudo apt-get -y install python-scipy sudo pip install --upgrade cython sudo pip install -U scikit-learn sudo pip install imutils sudo apt-get -y install python-sklearn sudo apt-get -y install python-skimage
- Tkinter (Version 3.4.2-1): https://wiki.python.org/moin/TkInter
sudo apt-get install python3-tk
Following are the commands used in Chapter 6, Detecting Edges and Contours in Images:
sudo apt-get install geany sudo apt-get -y install python-pip sudo apt-get -y install python-opencv sudo apt-get -y install python-numpy sudo apt-get -y install python-scipy sudo pip install --upgrade cython sudo pip install -U scikit-learn sudo pip install imutils sudo apt-get -y install python-sklearn sudo apt-get -y install python-skimage
- pip-3.2 (Version 1.1-3): http://www.pip-installer.org/en/latest
sudo apt-get install python3-pip
- Pi3D (Version 2.13): http://pi3d.github.iosudo
pip-3.2 install pi3d
Also, take a look at 3D Graphics with Pi3D:
http://paddywwoof.github.io/pi3d_book/_build/latex/pi3d_book.pdf
Following are the commands used in Chapter 8, Building Face Detector and Face Recognition Applications:
sudo apt-get install geany sudo apt-get -y install python-pip sudo apt-get -y install python-opencv sudo apt-get -y install python-numpy sudo apt-get -y install python-scipy sudo pip install --upgrade cython sudo pip install -U scikit-learn sudo pip install imutils sudo apt-get -y install python-sklearn sudo apt-get -y install python-skimage
- RPi.GPIO is usually pre-installed on Raspbian (Version 0.6.2~jessie-1): http://sourceforge.net/p/raspberry-gpio-python/wiki/BasicUsage
sudo apt-get install python3-rpi.gpio
- flite (Version 1.4 release-12): http://www.festvox.org/flite
sudo apt-get install flite
- uInput (Version 0.11.2): http://tjjr.fi/sw/python-uinput
Installation instructions are provided in Chapter 9, Using Python to Drive Hardware:
- i2c-tools (Version 3.1.1+svn-2): http://www.lm-sensors.org/wiki/I2CTools
sudo apt-get install i2c-tools
- pip-3.2 (Version 1.5-6-5): http://www.pip-installer.org/en/latest
sudo apt-get install python3-pip
- python3-dev (Version 3.4.2-2): header files and static library for Python required for some software
sudo apt-get install python3-dev
- wiringpi2 (Version 2.32.3): http://wiringpi.com
sudo pip-3.2 install wiringpi2
Following are the commands used in Chapter 11, Building Neural Network Module for Optical Character Recognition:
sudo apt-get install geany sudo apt-get -y install python-pip sudo apt-get -y install python-opencv sudo apt-get -y install python-numpy sudo apt-get -y install python-scipy sudo pip install --upgrade cython sudo pip install -U scikit-learn sudo pip install imutils sudo apt-get -y install python-sklearn sudo apt-get -y install python-skimage sudo pip install -U nltk sudo pip install neurolab
- wiringpi2 (Version 2.32.3): http://wiringpi.com
sudo pip-3.2 install wiringpi2
- ServoBlaster (Version 2.32.3): https://github.com/richardghirst/PiBits
sudo pip-3.2 install wiringpi2
- RPi.GPIO is usually pre-installed on Raspbian (Version 0.6.2~jessie-1):http://sourceforge.net/p/raspberry-gpio-python/wiki/BasicUsage
sudo apt-get install python3-rpi.gpio
- Tkinter (Version 3.4.2-1): https://wiki.python.org/moin/TkInter
sudo apt-get install python3-tk
- wiringpi2 (Version 2.32.2): http://wiringpi.com
sudo pip-3.2 install wiringpi2
- minicom (Version 2.7-1): http://linux.die.net/man/1/minicom
sudo apt-get install minicom
- pyserial (Version 2.6): http://pyserial.sourceforge.net
sudo pip-3.2 install pyserial
- pyusb (Version 1.0.0): https://github.com/walac/pyusb
sudo pip-3.2 install pyusb
Following are the commands used in Chapter 14, Can I Recommend a Movie for You?:
sudo apt-get install geany sudo apt-get -y install python-pip sudo apt-get -y install python-opencv sudo apt-get -y install python-numpy sudo apt-get -y install python-scipy sudo pip install --upgrade cython sudo pip install -U scikit-learn sudo pip install imutils sudo apt-get -y install python-sklearn sudo apt-get -y install python-skimage
The majority of the Raspberry Pi software packages used in the book have been installed
and configured using apt-get
and pip
. Useful commands have been given for each in the following sections.
The following are the useful commands for APT (this is pre-installed by default on Raspbian):
- Always update the package list to obtain the latest versions and programs before installing a package with the
sudo apt-get update
command - Find software by searching for any packages that include the
<searchtext>
command in the package name or description usingsudo apt-cache search <seachtext>
- Install software with a particular
<packagename>
usingsudo apt-get install <packagename>
- Uninstall a particular software package using
sudo apt-get remove <packagename>
- Display the currently installed version of a software package using
sudo apt-cache showpkg <packagename>
If you want to install a specific version of a software package, use sudo apt-get install <package name>=<version>
Note
If you need to use the packages on a system without internet access, you can use the following command to download the packages (and their dependencies) to the specified directory:sudo apt-get -o dir::cache::archives="<target_directory>" -d -y install <package name>
You can see the details of additional commands by running sudo apt-get
and sudo apt-cache
. Alternatively, they are listed by reading the manual pages using the man
command, the man apt-get
command, and the man apt-cache
command.
Useful commands for Pip (this is not usually pre-installed on Raspbian) are listed as follows:
- To install Pip or Python 3, use the
sudo
apt-get install python3-pip
command - Install the required package using
sudo pip-3.2 install <packagename>
- Uninstall a particular package using
sudo pip-3.2 uninstall
<packagename>
- To find out the version of an installed package, use
pip-3.2 freeze | grep <packagename>
- Install a specific package version using
sudo pip-3.2 install <packagename>==<version>
For example, to check the version of Pi3D installed on your system, usepip-3.2 freeze | grep pi3d
.
To replace the installed version of Pi3D with Version 2.13, usesudo pip-3.2 uninstall pi3d
and sudo pip-3.2 install pi3d==2.13
.