admin

Installing Python on Windows (Anaconda)

Programming




This tutorial will demonstrate how you can install Anaconda, a powerful package manager, on Microsoft Windows.


What is Anaconda?

Anaconda is a distribution of Python. It is free and open-source and makes package management and deployment simpler. Keep reading to see how. It is the standard platform for Python data science and open-source machine learning. Anaconda is used by data scientists, IT professionals and business leaders.


Why should you use Python Anaconda?

  • It is free and open-source
  • It has more than 1500 Python/R data science packages
  • Anaconda simplifies package management and deployment
  • It has tools to easily collect data from sources using machine learning and AI
  • It creates an environment that is easily manageable for deploying any project
  • Anaconda is the industry standard for developing, testing and training on a single machine
  • It has good community support- you can ask your questions there.

Python Anaconda Installation

Follow the steps below to install the Anaconda distribution of Python on Windows.


  1. Visit the Anaconda downloads page
  2. Go to the following linkAnaconda.com/downloads

    The Anaconda Downloads Page will look like this:

    anaconda_download_page

    Figure 1 - Anaconda distribution of Python download page


  3. Select Windows
  4. Select Windows where the three operating systems are listed.

    anaconda_select_windows

    Figure 2 - Anaconda downloads page


  5. Download
  6. Download the most recent Python 3 release. At the time of writing, the most recent release was the Python 3.7 Version. Python 2.7 is legacy Python. For problem solvers, select the Python 3.7 version. If you are unsure if your computer is running a 64-bit or 32-bit version of Windows, select 64-bit as 64-bit Windows is most common.

    anaconda_python3_or_python2

    Figure 3 - Select Python version

    You may be prompted to enter your email. You can still download Anaconda if you click [No Thanks] and don't enter your Work Email address.

    anaconda_enter_email

    Figure 4 - Part of Anaconda installation

    The download is quite large (over 500 MB) so it may take a while to for Anaconda to download.

    anaconda_downloading

    Figure 5 - Anaconda downloading


  7. Open and run the installer
  8. Once the download completes, open and run the .exe installer. At the beginning of the install, you need to click Next to confirm the installation.

    anaconda_installer_click_next

    Figure 6 - Welcome to Anaconda installation screen

    Then agree to the license.

    anaconda_agree_to_license

    Figure 7 - Anaconda End User License Agreement

    At the Advanced Installation Options screen, you’ll get some advanced options. You can add Anaconda to your system’s PATH environment variable, and register it as the primary system Python 3.7. If you add it to PATH, it will be found before any other installation. Click on 'Install'.

    anaconda_path2

    Figure 8 - Click on Install


  9. Open the Anaconda Prompt from the Windows start menu
  10. After the installation of Anaconda is complete, you can go to the Windows start menu and select the Anaconda Prompt.

    This opens the Anaconda Prompt. Anaconda is the Python distribution and the Anaconda Prompt is a command line shell (a program where you type in commands instead of using a mouse). The black screen and text that makes up the Anaconda Prompt doesn't look like much, but it is really helpful for problem solvers using Python.

    At the Anaconda prompt, type python and hit [Enter]. The python command starts the Python interpreter, also called the Python REPL (for Read Evaluate Print Loop).

    python
    Python 3.7.1 | (default, Dec 10 2018, 22:54:23) [MSC v.1915 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>>
    		

    To close the Python interpreter, type exit() at the prompt >>>. Note the double parenthesis at the end of the exit() command. The () is needed to stop the Python interpreter and get back out to the Anaconda Prompt.

    To close the Anaconda Prompt, you can either close the window with the mouse, or type exit, no parenthesis necessary.

    When you want to use the Python interpreter again, just click the Windows Start button and select the Anaconda Prompt and type python.


If you search for Anaconda now, you will see the following options:

  • The Anaconda prompt
  • Anaconda Navigator
  • Anaconda Powershell prompt
  • Spyder IDE
  • Jupyter Notebook

If you go to your command prompt and type ‘jupyter notebook’, it will open the Jupyter dashboard for you.

Jupyter

Figure 9 - Jupyter Notebote

You can create a new notebook from the New menu at the top right.

new-notebook-in-jupyter

Figure 10 - Create new Jupyter Notebote

This is your new notebook. You can type in this. To execute a statement or multiple statements at once, press Shift+Enter. Pressing only Enter will only take you to the next line.

new-notebook

Figure 11 - New Notebote


Installing Python Anaconda Libraries

You have successfully installed Anaconda. Now, let’s see how to install libraries or packages with it.

Open the Anaconda Prompt and use the 'conda install command' with the package name.

conda-install

Figure 12 - Install new package


Happy Coding! :)