This chapter is taken from the book A Primer on Scientific Programming with Python by H. P. Langtangen, 5th edition, Springer, 2016.

Anaconda and Spyder

Anaconda is a free Python distribution produced by Continuum Analytics and contains over 400 Python packages, as well as Python itself, for doing a wide range of scientific computations. Anaconda can be downloaded from http://continuum.io/downloads.

The Integrated Development Environment (IDE) Spyder is included with Anaconda and is my recommended tool for writing and running Python programs on Mac and Windows, unless you have preference for a plain text editor for writing programs and a terminal window for running them.

Spyder on Mac

Spyder is started by typing spyder in a (new) Terminal application. If you get an error message unknown locale, you need to type the following line in the Terminal application, or preferably put the line in your $HOME/.bashrc Unix initialization file:

export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8

Installation of additional packages

After installing Anaconda you have the conda tool at hand for installing additional packages registered on binstar.org. For example,

Terminal> sudo conda install --channel johannr scitools

(You do not need sudo on Windows.)

Anaconda also installs the pip tool that is handy for installing additional packages that are not on binstar.org. In a Terminal application on Mac or in a PowerShell terminal on Windows, write

Terminal> sudo pip install --user packagename

(Drop sudo on Windows.)