Reader small image

You're reading from  Computer Vision Projects with OpenCV and Python 3

Product typeBook
Published inDec 2018
Reading LevelIntermediate
PublisherPackt
ISBN-139781789954555
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Matthew Rever
Matthew Rever
author image
Matthew Rever

Matthew Rever received his PhD. in electrical engineering from the University of Michigan, Ann Arbor. His career revolves around image processing, computer vision, and machine learning for scientific research applications. He started programming in C++, a language he still uses today, over 20 years ago, and has also used Matlab and most heavily Python in the past few years, using OpenCV, SciPy, scikit-learn, TensorFlow, and PyTorch. He believes it is important to stay up to date on the latest tools to be as productive as possible. Dr. Rever is the author of Packt's Computer Vision Projects with Python 3 and Advanced Computer Vision Projects.
Read more about Matthew Rever

Right arrow

Introducing and installing Python and Anaconda

The first thing we need is Python 3. The best way to install this is by downloading Continuum Analytics and the Anaconda distribution.

Anaconda is a fully-featured Python distribution that comes with a lot of packages, including numerical analytics, data science, and computer vision. It's going to make our lives a whole lot easier, because it provides us with libraries that are not present in the base Python distribution.

The best part about Anaconda is that it gives us the conda package manager, along with pip, which makes it very easy to install external packages for our Python distribution.

Let's get started.

Installing Anaconda

We will begin by setting up our Anaconda and Python distribution, using the following steps:

  1. Go to the Anaconda website, using the following link www.anaconda.com/download. You should see a landing page that looks similar to the following screenshot:
  1. Next, select your OS and download the latest version of the Anaconda distribution, which includes Python 3.7. Click the Download button, as shown in the following screenshot:
The installer for Windows is graphical; however, you might need to use a command-line installer for macOS or Linux.

Installing the setup file is pretty straightforward, so we won't go through each step here.

  1. When you have everything properly installed and your path variables defined, go to the Command Prompt and make sure everything is good to go by typing the where python command. This shows us all the directories in which Python is installed. You should see something similar to the following screenshot:

As seen in the preceding screenshot, we see that the first instance of Python is in our Anaconda distribution. This means that we can proceed with our Python programs.

In macOS or Linux, the command would be which python instead of where python.
  1. Now, let's make sure we have our other tools. Our first tool will be IPython, which is essentially a command shell for interactive computing in multiple programming languages. We will check it using the where ipython command, as shown in the following screenshot:
  1. The next package we will check is the pip tool, which is the Python installer package. We do this with the where pip command, as shown in the following screenshot:
  1. The next tool to check is the conda package, which is Anaconda's built-in package manager. This is done using the where conda command, as shown in the following screenshot:

We should be good to go with Python now.

If you run which python on macOS or Linux, and it says something such as user/bin/Python, that means Python is either not installed or it's not the first thing in our path, so we should modify that as per our system.

In the next section, we're going to cover installing additional libraries such as OpenCV, TensorFlow, dlib, and Tesseract, which will be used for the projects in this book.

Previous PageNext Page
You have been reading a chapter from
Computer Vision Projects with OpenCV and Python 3
Published in: Dec 2018Publisher: PacktISBN-13: 9781789954555
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.
undefined
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

Author (1)

author image
Matthew Rever

Matthew Rever received his PhD. in electrical engineering from the University of Michigan, Ann Arbor. His career revolves around image processing, computer vision, and machine learning for scientific research applications. He started programming in C++, a language he still uses today, over 20 years ago, and has also used Matlab and most heavily Python in the past few years, using OpenCV, SciPy, scikit-learn, TensorFlow, and PyTorch. He believes it is important to stay up to date on the latest tools to be as productive as possible. Dr. Rever is the author of Packt's Computer Vision Projects with Python 3 and Advanced Computer Vision Projects.
Read more about Matthew Rever