This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
howto:python:start [2013/01/17 10:39] adymond |
howto:python:start [2021/12/09 16:42] (current) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Python ====== | ====== Python ====== | ||
| - | .profile | + | See the [[guide:python|Python User Guide]]. |
| - | source .bashrc | + | |
| - | + | ||
| - | .bashrc : | + | |
| - | + | ||
| - | export PATH=$HOME/ | + | |
| - | + | ||
| - | #gcc | + | |
| - | module add gcc/4.7.2 | + | |
| - | export LD_LIBRARY_PATH=/ | + | |
| - | + | ||
| - | # Python 2.6.5 on / | + | |
| - | export PATH=/ | + | |
| - | export LD_LIBRARY_PATH=/ | + | |
| - | + | ||
| - | Thats it. The / | + | |
| - | $ ipython | + | |
| - | $ import numpy | + | |
| - | $ numpy.test() | + | |
| - | + | ||
| - | ===== Installing packages ===== | + | |
| - | + | ||
| - | Assuming your codes are to be run on the dell cluster, add the following lines to your .bashrc file | + | |
| - | #if feature=dell check still needs to be added | + | |
| - | export PYTHONPATH=~/ | + | |
| - | export PATH=$HOME/ | + | |
| - | + | ||
| - | create the required directories | + | |
| - | $ mkdir -p $HOME/ | + | |
| - | $ mkdir -p $HOME/ | + | |
| - | + | ||
| - | + | ||
| - | ==== setuptools ==== | + | |
| - | + | ||
| - | Use for tool for managing and install Python packages. Setuptool provides the // | + | |
| - | + | ||
| - | $ cd tmp | + | |
| - | $ wget http:// | + | |
| - | $ tar -xf setuptools-0.6c11.tar.gz | + | |
| - | $ cd setuptools-0.6c11 | + | |
| - | $ python setup.py install --prefix=$HOME/ | + | |
| - | + | ||
| - | ==== argparse ==== | + | |
| - | + | ||
| - | From the login node (which has http access) simply | + | |
| - | $ easy_install --prefix=$HOME/ | + | |
| - | + | ||
| - | + | ||
| - | ==== numpy (minimal) ==== | + | |
| - | + | ||
| - | $ msub -I -l feature=dell | + | |
| - | $ cd ~/tmp | + | |
| - | $ ssh login01 wget http:// | + | |
| - | $ mv ../ | + | |
| - | $ tar -xf numpy-1.6.2.tar.gz | + | |
| - | $ cd numpy-1.6.2 | + | |
| - | $ export ATLAS=None | + | |
| - | $ export BLAS=None | + | |
| - | $ export LAPACK=None | + | |
| - | $ python setup.py build --fcompiler=gnu95 | + | |
| - | $ python setup.py install --prefix=$HOME/ | + | |
| - | + | ||
| - | when testing you should get | + | |
| - | $ ipython | + | |
| - | import numpy | + | |
| - | numpy.test() | + | |
| - | Ran 3568 tests in 11.266s | + | |
| - | + | ||
| - | OK (KNOWNFAIL=5, | + | |
| - | Out[3]: < | + | |
| - | + | ||
| - | ==== scipy (minimal) ==== | + | |
| - | + | ||
| - | + | ||
| - | $ msub -I -l feature=dell | + | |
| - | $ cd ~/tmp | + | |
| - | $ ssh login01 wget http:// | + | |
| - | $ mv ../ | + | |
| - | $ tar -xf scipy-0.10.1.tar.gz | + | |
| - | $ cd scipy-0.10.1/ | + | |
| - | $ python | + | |
| - | $ python setup.py install --prefix=$HOME/ | + | |
| - | + | ||
| - | testing, | + | |
| - | $ cd ~/ | + | |
| - | $ ipython | + | |
| - | import scipy | + | |
| - | scipy.__path__ | + | |
| - | scipy.test() | + | |
| - | + | ||
| - | which did not work 100 % :( | + | |
| - | + | ||
| - | FAILED (KNOWNFAIL=13, | + | |
| - | Out[2]: < | + | |
| - | + | ||
| - | ==== matplotlib / pylab ==== | + | |
| - | + | ||
| - | $ msub -I -l feature=dell | + | |
| - | $ cd ~/tmp | + | |
| - | $ ssh login01 wget http:// | + | |
| - | $ mv ../ | + | |
| - | $ tar -xf matplotlib-1.2.0.tar.gz | + | |
| - | $ cd matplotlib-1.2.0 | + | |
| - | $ python setup.py install --prefix=$HOME/ | + | |
| - | + | ||
| - | ==== mpi4py ==== | + | |
| - | + | ||
| - | Is already installed, all that is needed is to load the openmpi module; add the following line to // | + | |
| - | module add openmpi-1.6.1-intel | + | |
| - | + | ||
| - | + | ||