In [1]:
%load_ext load_style
%load_style talk.css
In [2]:
from IPython.display import HTML

conda and anaconda


anaconda

anaconda is a Scientific Python distribution, developed by , from their web-page:

Anaconda is a completely free enterprise-ready Python distribution for large-scale data processing, predictive analytics, and scientific computing

some advantages:

In [3]:
HTML('<iframe src = https://store.continuum.io/cshop/anaconda/ width=900 height=350></iframe>')
Out[3]:


conda

conda is a package and environment management system akin to virtualenv

example, I want to test the iris and cartopy packages.

These are developed by the UK Met. Office.

  • iris is a Python package for analysing and visualising meteorological and oceanographic data sets
  • cartopy is a Python package for advanced map generation with a simple matplotlib interface.

problem is that they require older versions of numpy and other libraries, and I don't want to mess up my main environment

first create a conda environment named iris, with the minimum: python and ipython [+ libraries for the notebook]

ᐅ conda create -n iris python ipython ipython-notebook

then:

ᐅ source activate iris

and to install (in the iris environment) using the binstar service (see below first)

ᐅ conda install -c https://conda.binstar.org/scitools cdat-lite
ᐅ conda install -c https://conda.binstar.org/scitools iris
ᐅ conda install -c https://conda.binstar.org/scitools cartopy

A (quick and dirty) exploration of iris and cartopy can be found in this notebook

IMPORTANT: you need to launch a new instance of the IPython notebook from the iris environment:

~/Documents/talks_seminars/Python_NIWA_April2015/session_2/notebookss  ᐅ source activate iris

(iris)~/Documents/talks_seminars/Python_NIWA_April2015/session_2/notebooks  ᐅ ipython notebook 

some useful conda commands:

  • list the existing environments
ᐅ conda env list
or 

ᐅ conda info -e
  • remove an environment
ᐅ conda env remove -n envname

binstar

binstar is a free service for hosting public packages for pip and conda

In [4]:
HTML('<iframe src = https://binstar.org/dashboard width=1000 height=600></iframe>')
Out[4]: