Quantum maps with python - Installation problems and notes
Below the following topics will be addressed:
In case of errors
- First check if python is installed at all by typing at the shell prompt
python
If not, you have to install python and Numeric yourself, see below.
- If this is successful try to import Numeric in Python
import Numeric
If this fails you have to install Numeric yourself, see below.
- If this is also okay try to import the LinearAlgebra module
import LinearAlgebra
If this fails one has to check the installation of Numeric ...
(i.e., this can be a more difficult problem with many different
reasons ...)
Installation notes
The following are brief installation notes
under UNIX (using bash syntax).
Usually things like this get out-dated
quickly, so in case of problems (or newer versions ;-) consult
the documentation of the corresponding programs.
Installation of Python
Step 1: get
Python-2.2.tgz (or more recent) from the
Python Homepage
Step 2: install via
# We use ${HOME}/PYTHON as homedirectory for Python
export PHOME=${HOME}/PYTHON
mkdir ${PHOME}
export PATH=${PHOME}/bin:${PATH}
tar xzf Python-2.2.tgz
cd Python-2.2
./configure --prefix=${PHOME}
make
make install
# the following is optional
make test
Note that this will take some time to build.
After the installation you should add
${PHOME}/bin
to your path,
export PATH=${PHOME}/bin:${PATH}
so that
python can be found.
Addtional remarks:
- if you have gnu readline use it
- also if you have Tcl/Tk, enable this as well in setup.py
Installation of Numeric
Step 1: get
Numeric-21.0.tar.gz (or more recent) from the
Numeric Homepage (under
Latest File Releases select the download under
numpy)
Step 2: install via
# If you haven't done this yet, also first execute
export PHOME=${HOME}/PYTHON
mkdir ${PHOME}
# and then
tar xzf Numeric-21.0.tar.gz
cd Numeric-21.0
python setup.py install --prefix=${PHOME}
Note that this will take some time to build.
(afterwards don't forget to set
PYTHONPATH if necessary, see below)
Installation of IPython
For interactive work I highly recommend IPython.
Step 1: get the most recent
IPython
Step 2: For example for
IPython-0.2.9.tar.gz install via
tar xzf IPython-0.2.9.tar.gz
cd IPython-0.2.9
python setup.py install --prefix=${PHOME}
Now you just type
ipython instead of
python
to enjoy all the benefits of IPython.
Installation when Python is already installed
In some cases python will already be installed on your machine.
To install
Numeric locally under your account
follow the above. To be able to import it you have
to tell python where to find it,
export PYTHONPATH=${PHOME}/lib/python2.2/site-packages/Numeric: \
${PHOME}/lib/python2.2/site-packages/
For IPython you should add
${PHOME}/bin
to your path,
export PATH=${PHOME}/bin:${PATH}
so that
ipython can be found.
Last modified: 27 October 2004, 16:21:49
Impressum, © Arnd Bäcker