Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Raspberry Pi 3 Cookbook for Python Programmers

You're reading from   Raspberry Pi 3 Cookbook for Python Programmers Unleash the potential of Raspberry Pi 3 with over 100 recipes

Arrow left icon
Product type Paperback
Published in Apr 2018
Publisher
ISBN-13 9781788629874
Length 552 pages
Edition 3rd Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Steven Lawrence Fernandes Steven Lawrence Fernandes
Author Profile Icon Steven Lawrence Fernandes
Steven Lawrence Fernandes
Tim Cox Tim Cox
Author Profile Icon Tim Cox
Tim Cox
Arrow right icon
View More author details
Toc

Table of Contents (23) Chapters Close

Title Page
Copyright and Credits
Dedication
Packt Upsell
Contributors
Preface
1. Getting Started with a Raspberry Pi 3 Computer FREE CHAPTER 2. Dividing Text Data and Building Text Classifiers 3. Using Python for Automation and Productivity 4. Predicting Sentiments in Words 5. Creating Games and Graphics 6. Detecting Edges and Contours in Images 7. Creating 3D Graphics 8. Building Face Detector and Face Recognition Applications 9. Using Python to Drive Hardware 10. Sensing and Displaying Real-World Data 11. Building Neural Network Modules for Optical Character Recognition 12. Building Robots 13. Interfacing with Technology 14. Can I Recommend a Movie for You? 1. Hardware and Software List 2. Other Books You May Enjoy Index

The software list


The book uses a range of software packages to extend the capabilities of the pre-installed software.

PC software utilities

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:

Raspberry Pi packages

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

Chapter 1

  • This chapter describes the hardware setup, and, therefore, the following packages are optional (or specific hardware drivers where necessary):
sudo apt-get install tightvncserver
sudo apt-get install samba

Chapter 2

Following are the commands used in Chapter 2Dividing 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

 

Chapter 3

sudo apt-get install python3-tk
sudo apt-get install python3-pip
sudo apt-get install libjpeg-dev
sudo pip-3.2 install pillow

Chapter 4

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

Chapter 5

sudo apt-get install python3-tk

Chapter 6

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

Chapter 7

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

Chapter 8

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

Chapter 9

sudo apt-get install python3-rpi.gpio
sudo apt-get install flite

Installation instructions are provided in Chapter 9Using Python to Drive Hardware:

Chapter 10

sudo apt-get install i2c-tools
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
sudo pip-3.2 install wiringpi2

Chapter 11

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

Chapter 12

sudo pip-3.2 install wiringpi2
sudo pip-3.2 install wiringpi2

Chapter 13

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

Chapter 14

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

There's more...

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.

APT commands

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 usingsudo apt-get remove <packagename>
  • Display the currently installed version of a software package usingsudo 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.

Pip Python package manager commands

Useful commands for Pip (this is not usually pre-installed on Raspbian) are listed as follows:

  • To install Pip or Python 3, use the sudoapt-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, usepip-3.2 freeze | grep <packagename>
  • Install a specific package version usingsudo 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.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime
Banner background image