User Tools

Site Tools


python

This is an old revision of the document!


Python

Python can be pain to maintain on your own, especially if you require up-to-date packages. To get around this, there are a number of Python distributions that bundle packages. These work independent of the default installation provided on your operating systems. The largest two are Enthought Canopy and Anaconda. You're free to install either in your home directory or your laptops.

For convenience, we provide a site-wide installation of Enthought Canopy on the zBox. It comes with the most wanted packages (IPython/Numpy/Scipy/Matplotlib/Scikit). You can use it as follows.

1) Create/edit the .bashrc file in your home and add

VIRTUAL_ENV_DISABLE_PROMPT=1 source /zbox/opt/Enthought/Canopy_64bit/User/bin/activate

2) If you are compiling stuff, you will also need to add

export LIBRARY_PATH=/zbox/opt/Enthought/Canopy_64bit/User/lib:$LIBRARY_PATH

3) Create/edit the .bash_profile file in your home and add

if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

4) Log out, log in again. Then type (in the shell) “which ipython”. It should return

/zbox/opt/Enthought/Canopy_64bit/User/bin/ipython

Also note:

  1. Pynbody is installed for the SPH-junkies among you.
  2. Pymses/amrviewer are also compiled. To use these, you need to add more lines to your .bashrc
PYTHONPATH=$PYTHONPATH:/zbox/opt/pymses_4.0.0
export PYTHONPATH

PATH=$PATH:/zbox/opt/pymses_4.0.0/bin
export PATH
  1. If you find this line somewhere in your .bashrc, .bash_profile, or .profile in your home directory, you should comment it out.

<file> # If not running interactively, don't do anything [ -z “$PS1” ] && return </file.

If you have trouble and/or need more packages, feel free to mail Volker.

If you use another shell (zsh, tcsh, …), you can likely figure out the appropriate steps yourself.

python.1411551841.txt.gz · Last modified: 2014/09/24 11:44 by volker