Average rainfall 2001-2016, global tropics

Map: Average rainfall 2001-2016, global tropics

Install Anaconda

Thomas Gumbricht bio photo By Thomas Gumbricht

Contents - Anaconda Python Environment - Download and install Anaconda - Checking, updating and extending Anaconda - Resources

Anaconda Python Environment

Python is a general purpose high-level programming language, and I use Python to do most of my GeoImagine. Most modern operating systems include one or more Python installations, and it can be difficult to keep track of Python installations and versions on your system. To bypass that problem, and also to get more control, as well as a complete and extendable Python installation, Anaconda is the solution.

Download and install Anaconda

Anaconda is a free platform for scientific Python. To download Anaconda, visit the Anaconda homepage, and look for the download link. In the download page, find the distribution (e.g. Windows, Linux, macOS) and the Python version (e.g. 2.X or 3.X) that you need. Since I wrote the original post (December 2017) I have switched from Python 2.7 to 3.8. Download the graphical installer, unless you feel comfortable with the command line version.

Note, the default location of the Anaconda installation for Karttur’s GeoImagine Framework is directly under the Applications folder.

Follow the official instructions for installing Anaconda on Mac OS X, or the shorthand instructions below.

Open the Anaconda installation package (.pkg) by double clicking. If you are denied installing, you need to bypass the MacOS security settings. The previous post contains a more detailed manual, with figures, on how to manoeuvre to get the installation past the security system. Go via the mac main menu, click the apple (absolute top left of the computer screen), select System Preferences…. In the top row of the System Preferences window, click the Security & Privacy icon. In the window that opens, under the General tab (usually in front by default), you should see a paragraph towards the bottom:

"Anaconda'version'.pkg" was blocked from opening...

Click the button Open Anyway, and try to install again. The installation should come one step further, but you still have to confirm that you want to to go ahead with the installation in a pop-up window. The installer will guide you through the installation. Remember that if you want to streamline the Anaconda installation for Karttur’s GeoImagine Framework you must change the installation destination to the Applications folder.

When the installation is finished, it asks if you want to install PyCharm IDE. I have not tested PyCharm IDE, but it seems worthwhile. At present PyCharm is not required for Kartturs´s GeoImagine Framework.

Checking, updating and extending Anaconda

Anaconda comes with a Navigator that assists you in keeping Anaconda up to date. The Anaconda-Navigator.app is found in the Anaconda main folder (that you defined during the installation). You can also check the versions of the different Python packages installed by Anaconda from the command line.

Open a Terminal window, and confirm that Anaconda is installed by typing at the prompt:

$ conda -V

To update your Anaconda distribution, type:

$ conda update conda

$ conda update anaconda

Anaconda comes with coherent packages, that can be used together. You can also install packages on your own, or install other versions of existing packages if needed. There are two different commands for installing packages, conda install and pip. Which to use depends on how the package you want to install is distributed. But you should have ‘pip’ installed. Check that pip is installed by writing at the Terminal prompt:

$ pip -V

If you installed Anaconda, you should have a pip version included in the Anaconda package. If you do not have pip installed, either user the Terminal and write:

$ sudo easy_install pip

Or go to the official pip homepage, that includes installation instruction.

The next step is either creating a virtual Python environment or to install and setup Eclipse IDE (Integrated Development Environment) for Python Developing (PyDev). There are many advantages with setting up PyDev using a virtual Python environment, so I recommend that you start with the post on Conda virtual environments.

Resources

Anaconda

Setup python with Anaconda by Jason Brownlee (Machine Learning Mastery).