Throughout this book, we'll be using Python as the main tool for performing business intelligence tasks. This recipe shows you how to get a specific Python distribution—Anaconda, installed.
Regardless of which operating system you use, open a web browser and browse to the Anaconda download page at http://continuum.io/downloads.
The download page will automatically detect your operating system.
In this section, we have listed the steps to install Anaconda for all the major operating systems: Mac OS X, Windows, and Linux.
Click on the I WANT PYTHON 3.4 link. We'll be using Python 3.4 throughout this book.
Next, click on the Mac OS X — 64-Bit Python 3.4 Graphical Installer button to download Anaconda.
Once the download completes, browse your computer to find the downloaded Anaconda, and double-click on the Anaconda installer file (a
.pkg
file) to begin the installation.Walk through the installer steps to complete the installation. I recommend keeping the default settings.
To verify that Anaconda is installed correctly, open a terminal and type the following command:
python
If the installer was successful, you should see something like this:
Click on the I WANT PYTHON 3.4 link. We'll be using Python 3.4 throughout this book.
Next, click on the Windows 64-Bit Python 3.4 Graphical Installer button to download Anaconda.
Once the download completes, browse your computer to find the downloaded Anaconda, and double-click on the
Anaconda3-2.3.0-Windows-x86_64.exe
file to begin the installation.Walk through the installer steps to complete the installation. I recommend keeping the default settings.
To verify that Anaconda has installed correctly, open a terminal, or open a command prompt in Windows. Now type the following command:
python
If the installation was successful, you should see something like this:
Linux servers have no graphical user interface (GUI), so you'll first need to log into your server and get a command prompt. With that complete, do the following:
On the Anaconda downloads page, select Linux.
Choose the Python 3.4 link.
Right-click on the Linux X 64-Bit button, and copy the link.
At the command prompt on your server, use
curl
to download the file, pasting the following download link:curl –O <LINK TO DOWNLOAD>
I've created a special shortcut on my website that is a bit easier to type at the command line: http://robertwdempsey.com/anaconda3-linux.
Once Anaconda downloads, use the following command to start the installer:
bash Anaconda3-2.3.0-Linux-x86_64.sh
Accept the license agreement to begin installation.
When asked if you would like Anaconda to prepend the Anaconda3 install location to the
PATH
variable, typeyes
.To have the
PATH
update take effect immediately after the installation completes, type the following command in the command line:source ~/.bashrc
Once the installation is complete, verify the installation by typing
python
in the command line. If everything worked correctly, you should see something like this:
Anaconda holds many advantages over downloading Python from http://www.python.org or using the Python distribution included with your computer, some of which are as follows:
Almost 90 percent of what you'll use on a day-to-day basis is already included. In fact, it contains over 330 of the most popular Python packages.
Using Anaconda on both the computer you use for development and the server where your solutions will be deployed helps ensure that you are using the same version of the Python packages that your applications require.
It's constantly updated; so, you will always be using the latest version of Python and the Python packages.
It works on all the major operating systems—Linux, Mac, and Windows.
It comes with tools to connect and integrate with Microsoft Excel.
At the time of writing this, the current version of Anaconda for Python 3 is 2.3.0.