官术网_书友最值得收藏!

Installing Anaconda

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.

Getting ready

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.

How to do it…

In this section, we have listed the steps to install Anaconda for all the major operating systems: Mac OS X, Windows, and Linux.

Mac OS X 10.10.4

  1. Click on the I WANT PYTHON 3.4 link. We'll be using Python 3.4 throughout this book.
  2. Next, click on the Mac OS X — 64-Bit Python 3.4 Graphical Installer button to download Anaconda.
  3. 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.
  4. Walk through the installer steps to complete the installation. I recommend keeping the default settings.
  5. To verify that Anaconda is installed correctly, open a terminal and type the following command:
    python
    
  6. If the installer was successful, you should see something like this:

Windows 8.1

  1. Click on the I WANT PYTHON 3.4 link. We'll be using Python 3.4 throughout this book.
  2. Next, click on the Windows 64-Bit Python 3.4 Graphical Installer button to download Anaconda.
  3. 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.
  4. Walk through the installer steps to complete the installation. I recommend keeping the default settings.
  5. To verify that Anaconda has installed correctly, open a terminal, or open a command prompt in Windows. Now type the following command:
    python
    
  6. If the installation was successful, you should see something like this:

Linux Ubuntu server 14.04.2 LTS

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:

  1. On the Anaconda downloads page, select Linux.
  2. Choose the Python 3.4 link.
  3. Right-click on the Linux X 64-Bit button, and copy the link.
  4. At the command prompt on your server, use curl to download the file, pasting the following download link:
    curl –O <LINK TO DOWNLOAD>
    
  5. 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.
  6. Once Anaconda downloads, use the following command to start the installer:
    bash Anaconda3-2.3.0-Linux-x86_64.sh
    
  7. Accept the license agreement to begin installation.
  8. When asked if you would like Anaconda to prepend the Anaconda3 install location to the PATH variable, type yes.
    • To have the PATH update take effect immediately after the installation completes, type the following command in the command line:
      source ~/.bashrc
      
  9. 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:

How it works…

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.

主站蜘蛛池模板: 竹山县| 金沙县| 石泉县| 怀安县| 竹溪县| 高淳县| 吉木乃县| 平顺县| 凤阳县| 轮台县| 靖安县| 田阳县| 西乌珠穆沁旗| 淅川县| 司法| 郁南县| 乌兰察布市| 从江县| 容城县| 沐川县| 江孜县| 包头市| 泗阳县| 临海市| 淳化县| 轮台县| 绿春县| 中卫市| 水城县| 南昌县| 凤庆县| 昆明市| 恩施市| 绥滨县| 扎兰屯市| 中超| 晋中市| 潮安县| 阳泉市| 宁波市| 广水市|