Tested on Ubuntu 13.10 and 14.04.
Requirements
sudo apt-get install python-pip python-dev
sudo pip install virtualenv virtualenvwrapper
echo "export WORKON_HOME=~/envs" >> ~/.bashrc
echo "source /usr/local/bin/virtualenvwrapper.sh" >> ~/.bashrc
echo "export PIP_REQUIRE_VIRTUALENV=true" >> ~/.bashrc
source ~/.bashrc
Create a virtual environment
mkvirtualenv <env_name> -p <path_to_python>*
*<path_to_python> can be either /usr/bin/python2 or /usr/bin/python3,
or whatever you need.
Install modules
pip install ipython[all]
pip install numpy
Test numpy
pip install nose
python -c 'import numpy; numpy.test()'
pip install cython
sudo apt-get build-dep python-scipy
sudo apt-get install libblas-dev liblapack-dev
pip install scipy
sudo apt-get install libncurses5-dev
pip install readline
Other dependencies
pip install python-dateutil sphinx pygments tornado
Graphical libraries for GUI building and IPython QT console
You can either install them inside the virtual environment:
pip install pyside
You must install PyQt4 globally:
sudo apt-get install python3-pyqt4 python3-sip python-qt4-dev
or
sudo apt-get install python-pyqt4 python-sip python-qt4-dev
I recommend installing them globally then linking from the virtual environment:
First install them:
sudo apt-get install python3-pyqt4 python3-pyside python3-sip
or
sudo apt-get install python-qt4 python-pyside python-sip python-qt4-dev
Then link them (with the virtualenv activated):
In [3] we can see a script to link any library to the virtual environment (save it in, e.g. symlink_pyqt4_and_sip.sh or ${WORKON_HOME}/postmkvirtualenv and execute it):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
|
Other interesting modules
sudo apt-get build-dep python-matplotlib
pip install pyparsing
pip install matplotlib
pip install scikit-image
pip install scikit-learn
sudo apt-get install libhdf5-dev
pip install numexpr
pip install tables
If you have problems importing tables, it might help downloading and compiling the HDF5 library.
pip install pandas
sudo apt-get install libhdf5-dev
pip install h5py
patsy and statsmodels
pip install patsy
pip install statsmodels
pip install pymc
Speed up execution
pip install bottleneck
pip install cythongsl
Neuroscience tools:
pip install nibabel
Nipy Dependencies:
pip install sphinx sympy networkx traits
pip install nipy
pip install nipype dipy nitime