{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"%load_ext load_style\n",
"%load_style talk.css"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"from IPython.display import HTML"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# conda and anaconda"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##
anaconda "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[anaconda](https://store.continuum.io/cshop/anaconda/) is a Scientific Python distribution, developed by [](), \n",
"from their web-page: \n",
" \n",
" Anaconda is a completely free enterprise-ready Python distribution for large-scale data processing, predictive analytics, and scientific computing\n",
" \n",
"some advantages: \n",
"\n",
"+ free \n",
"+ cross-platform \n",
"+ 195+ of the [most popular Python packages](http://docs.continuum.io/anaconda/pkg-docs.html) for science, math, engineering, data analysis, ... notably:\n",
"
\n",
" + NumPy\n",
" + SciPy\n",
" + Pandas\n",
" + IPython\n",
" + Matplotlib\n",
" + Numba\n",
" + Blaze\n",
" + Bokeh\n",
"
\n",
" \n",
"+ easily install, update, revert Python packages (with dependencies ..)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
""
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"HTML('')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##
conda"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[conda](http://conda.pydata.org/docs/) is a package and **environment management system** akin to virtualenv"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"example, I want to test the [iris](http://scitools.org.uk/iris/index.html) and [cartopy](http://scitools.org.uk/cartopy/index.html) packages.\n",
"\n",
"These are developed by the [UK Met. Office](http://scitools.org.uk/).\n",
"\n",
"+ [iris](http://scitools.org.uk/iris/index.html) is a Python package for analysing and visualising meteorological and oceanographic data sets\n",
"+ [cartopy](http://scitools.org.uk/cartopy/index.html) is a Python package for advanced map generation with a simple matplotlib interface.\n",
"\n",
"problem is that they require older versions of numpy and other libraries, and I don't want to mess up my main environment"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"first create a conda environment named *iris*, with the minimum: python and ipython [+ libraries for the notebook]\n",
"\n",
" ᐅ conda create -n iris python ipython ipython-notebook\n",
"\n",
"then: \n",
"\n",
" ᐅ source activate iris\n",
"\n",
"and to install (in the `iris` environment) using the binstar service (see below first)\n",
"\n",
" ᐅ conda install -c https://conda.binstar.org/scitools cdat-lite\n",
" ᐅ conda install -c https://conda.binstar.org/scitools iris\n",
" ᐅ conda install -c https://conda.binstar.org/scitools cartopy"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"A (quick and dirty) exploration of iris and cartopy can be found in [this notebook](./iris_cartopy.ipynb)\n",
"\n",
"IMPORTANT: **you need to launch a new instance of the jupyter notebook from the `iris` environment**: \n",
"\n",
" ~/Documents/talks_seminars/Python_NIWA_April2015/session_2/notebookss ᐅ source activate iris\n",
"\n",
" (iris)~/Documents/talks_seminars/Python_NIWA_April2015/session_2/notebooks ᐅ jupyter notebook "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"some useful conda commands: \n",
"\n",
"+ list the existing environments\n",
" \n",
"```\n",
"ᐅ conda env list\n",
"``` \n",
"\n",
" or \n",
"\n",
"```\n",
"ᐅ conda info -e\n",
"``` \n",
"\n",
"+ remove an environment\n",
"\n",
"```\n",
"ᐅ conda env remove -n envname\n",
"```"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## anaconda.org and conda-forge"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[anaconda.org](http://anaconda.org/) is a free service for hosting public packages for pip and conda, you need to register (for free) and you can install third-party packages not part of the anaconda distribution prepared and compiled for your platform"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"see also [https://conda-forge.github.io/](https://conda-forge.github.io/) for another service"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.1"
},
"latex_envs": {
"bibliofile": "biblio.bib",
"cite_by": "apalike",
"current_citInitial": 1,
"eqLabelWithNumbers": true,
"eqNumInitial": 0
}
},
"nbformat": 4,
"nbformat_minor": 0
}