-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Raspberry Pi 3 Cookbook for Python Programmers
By :

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:
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):
Supporting website
:Install command
sudo apt-get install tightvncserver
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
sudo apt-get install python3-tk
sudo apt-get install python3-pip
sudo apt-get install libjpeg-dev
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
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
sudo apt-get install python3-pip
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
sudo apt-get install python3-rpi.gpio
sudo apt-get install flite
Installation instructions are provided in Chapter 9, Using Python to Drive Hardware:
sudo apt-get install i2c-tools
sudo apt-get install python3-pip
sudo apt-get install python3-dev
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
sudo pip-3.2 install wiringpi2
sudo pip-3.2 install wiringpi2
sudo apt-get install python3-rpi.gpio
sudo apt-get install python3-tk
sudo pip-3.2 install wiringpi2
sudo apt-get install minicom
sudo pip-3.2 install pyserial
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):
sudo apt-get update
command<searchtext>
command in the package name or description usingsudo apt-cache search <seachtext>
<packagename>
usingsudo apt-get install <packagename>
sudo apt-get remove <packagename>
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>
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:
sudo
apt-get install python3-pip
commandsudo pip-3.2 install <packagename>
sudo pip-3.2 uninstall
<packagename>
pip-3.2 freeze | grep <packagename>
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
.
Change the font size
Change margin width
Change background colour