Quantcast
Channel: solem's vision blog
Viewing all articles
Browse latest Browse all 31

Anaconda for Scientific Computing and Computer Vision

$
0
0
I recently came across the Anaconda Python distribution. It comes with Python, NumPy, SciPy, Pandas, Matplotlib, Numba and many other packages and you can set up virtual environments for any combination of Python and package versions. Since it uses vistual environments it installs in a folder and doesn't mess with your other Python installations. A list of included packages is here.

Using Anaconda


Here's the quick version of how to get started. Open a terminal and create an environment. For example, to create a new named environment with Python 2.7:

$ conda create -n py27 python=2.7 anaconda
To activate this environment, use:

$ source activate py27
To deactivate this environment, use:

$ source deactivate
Activation and deactivation works the same as Python's virtualenv (as far as I can tell).

Try an example with images, machine learning, and plotting


Download the scikit image quantization example. Activate your environment:

$ source activate py27
Notice that the prompt shows you are in the environment. Start an iPython session:

(py27)$ ipython --pylab
Run the file you downloaded:

In [1]: execfile("plot_color_quantization.py")
You should get three plots like the ones described here. Here's one of them

Viewing all articles
Browse latest Browse all 31

Trending Articles