Conda is a cross platform package manager which installs binary conda packages.
# On mac
python
import numpy
conda --help
conda list # not much installed
conda install scipy # notice dependency resolution
conda insall matplotlib ipython
conda install pandas # notice that version 0.16.2 installed
conda remove pandas
conda install pandas=0.14
conda list # not much installed
ipython
import pandas
pandas.__version__ # 0.14.1
conda update pandas
ipython
import pandas
pandas.__version__ # 0.16.2
# On Windows in the ChiPy environment
pip install numpy # Visual C++ what, what what...
conda install numpy
conda install scipy matplotlib ipython
ipython --pylab
import numpy
import scipy
plot(sin(linspace(-pi, pi)))
Conda can create isolated environments that have their own set of installed and managed packages.
# source deactivate
conda create --name chipy_py27 python=2.7 # who likes Python 2.7
source activate chipy_py27
python
>>> 5 / 2 # 2...wait
>>> 1 / 2 # 0
>>> round(1.2) 1.0
conda install numpy
python
import numpy
numpy.__version__
soure deactivate
conda create -n chipy_py34 python=3.4 numpy=1.7 # fail
conda create -n chipy_py34 python=3.4 numpy=1.8
source activate chipy_py34
python
>>> 5 / 2 # 2.5 better
>>> 1 / 2 # 0.5
>>> round(1.2) 1
type(round(1.2))
numpy.__version__ # 1.8.2
Packages are hard linked into the enviroment to save disk space.
Conda can search for packages from the repository provided by Continuum as well as packages created by users and shared on Anaconda.org
conda search basemap
conda search cartopy
conda server search cartopy
anaconda show shoyer/cartopy
# Search on Anaconda.org
Conda packages can be built from a recipe and shared on Anaconda.org
cd recipe/pyart
cd ..
conda build pyart
<lots of text>
anaconda search pyart
anaconda show jjhelmus/pyart
conda create -n radar_fun python=2.7
source activate radar_fun
conda install --channel https://conda.anaconda.org/jjhelmus pyart
conda install ipython basemap
ipython --pylab
import urllib
import pyart
url = 'ftp://tgftp.nws.noaa.gov/SL.us008001/DF.of/DC.radar/DS.p19r0/SI.klot/sn.last'
f = urllib.urlopen(url)
radar = pyart.io.read_nexrad_level3(f)
display = pyart.graph.RadarMapDisplay(radar)
display.plot_ppi_map('reflectivity', vmin=-32, vmax=80, cmap='pyart_NWSRef', resolution='c', embelish=False)
display.basemap.drawcounties()
draw()
Conda is available through Anaconda or Miniconda. It cannot be installed seperately.
Both Anaconda and Miniconda install into a single directory. Try one out! You can always remove this directory to get back your original Python setup.