4 steps to Python

  1. Install Python using Miniconda
  2. Install the Jupyter Notebook
  3. Install core scientific packages
  4. Run the Jupyter Notebook

1. Install Python using Miniconda

../_images/miniconda.png

We recommend Miniconda (even if you have Python already installed).

Miniconda installers contains Python and the Conda package manager. Installers exist for Windows, Mac, and Linux. Download the installer that matches your operating system and follow the directions to install miniconda on your computer. Except in very special circumstances, we recommend installing Python 3. (Why?)

Once installed, Miniconda becomes a folder that contains everything Python and Conda related. If anything ever goes wrong with your Python setup, you can always remove the Miniconda folder and start over.

Conda will be your main tool for installing Python packages moving forward. It installs packages through a mechanism known as conda-recipes. (It’s important to note, it can do `many other`_ things as well.) Conda also manages package updates and creates virtual environments.

pip is another tool for installing Python packages (and comes with Miniconda). If a conda-recipe does not exist for a package, you can try installing using pip.

2. Install the Jupyter Notebook.

To install new Python packages using Conda, you’ll need to use a command line.

On Windows, use the new Anaconda prompt application installed by Miniconda.

On Mac and Linux, use the Terminal application.

../_images/terminal.png

In general, you’ll type conda install some_package_name to install new packages. If conda cannot find the package, try using pip.

# Installing with conda
> conda install some_package_name

# Installing with pip
> pip install some_package_name

3. Install core scientific packages

../_images/notebook.png

Before you run Jupyter, you’ll want to install some core scientific packages. These packages allow you to produce awesome notebooks like the one shown to the right.

  • Matplotlib is Python’s most popular plotting package.
  • Numpy and SciPy are Python’s fundamental packages for scientific computing.
> conda install numpy scipy matplotlib

A more comprehensive list of Python packages for scientific computing can be found here.

4. Run the Jupyter Notebook

Open Jupyter Notebooks using the command line again (why?). Run the following command:

> jupyter notebook

Your output on the command line will look something like this:

../_images/jupyter-terminal.png

And the notebook application will launch in a browser window.