How to do it...

We will be installing a number of packages with pip.  These packages are installed into a Python environment.  There often can be version conflicts with other packages, so a good practice for following along with the recipes in the book will be to create a new virtual Python environment where the packages we will use will be ensured to work properly.

Virtual Python environments are managed with the virtualenv tool.  This can be installed with the following command:

~ $ pip install virtualenvCollecting virtualenv Using cached virtualenv-15.1.0-py2.py3-none-any.whlInstalling collected packages: virtualenvSuccessfully installed virtualenv-15.1.0

Now we can use virtualenv.  But before that let's briefly look at pip. This command ...

Get Python Web Scraping Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.