Installation for Linux
Most modern Linux distributions will have ways of installing the packages listed below automatically, using package management systems. For example, Debian and Ubuntu, use the apt (and aptitude) package manager, and Redhat uses the Redhat Package Manager (rpm). With these you should be able to install pre-built instances of the required modules. It doesn't matter if the versions are slightly older than those listed here.
For instance, to install subversion only requires:
% sudo apt-get install subversion
on Ubuntu and Debian Linux.
1. Python
The version of Python we are using is 2.5.2 which is the most recent stable release.
The general Python 2.5 installation instructions are available here.
Practically all flavors of Linux have at least one version of Python installed, so the only problem is ensuring that it is 2.5.2 that you are actually installing the extra modules into, i.e. running python may not select 2.5.2 in your distribution.
Also, many distributions (e.g. all RedHat derived versions) use Python for many system tasks, so you should not copy your new python2.5 version over the top of any existing binaries named python, otherwise you might get a nasty surprise with parts of your system not working correctly.
2. Python Modules
To check Python has been installed correctly, and you are using version 2.5, you should open a terminal and type:
~$ python2.5 Python 2.5.1 (r251:54863, Jun 11 2007, 21:47:49) [GCC 4.0.0] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>>
and you should see that you are using Python 2.5.2 (or 2.5.1 is ok too) and not an older version.
2.1 NumPy (Numerical Python library)
We are using NumPy 1.0.4 which is available from the SciPy download page.
For NumPy and SciPy there are detailed build instructions for Linux on the |SciPy website.
For many Linux distributions there are reasonably up to date versions of NumPy and SciPy in managed within the distributions' package management systems. So it pays to check whether your distribution has preprepared packages before going to the trouble of building the package from scratch.
2.2 SciPy (Scientific Python library)
We will be using SciPy 0.6 which is available from the SciPy download page.
2.4 matplotlib (Matlab like plotting library)
We will be using matplotlib 0.91.2 which is available from the matplotlib download page.
A similar story to NumPy and SciPy applies here for installing matplotlib. There are no pre-compiled binaries available for matplotlib, but it is supported by some of the package distributions (e.g. Ubuntu has a python-matplotlib package).
Once matplotlib is installed you should be able to go:
>>> import matplotlib
in the interactive Python interpreter and it should not return an error message.
At the same time you might like to grab a copy of the matplotlib example files which can be downloaded as a single zip file.
Once you have unzipped the examples they can be run from the Terminal window. For example, if cd into the examples directory, and type:
~> cd examples ~> python histogram_demo.py
a window should pop up containing an example histogram.
2.5 SOAPpy and fpconst (Web services library)
SOAPpy and fpconst are libraries that require manual installation. SOAPpy needs fpconst to handle special floating point values such as infinity and NaN (not a number). We will use fpconst version 0.7.3 which is available from the RSoap download page. You need the fpconst zip file.
Once you have downloaded the zip file, unpack it into a directory. You need to change into the directory where you unzipped fpconst:
~> cd fpconst-0.7.3
You then need to run the Python interpreter on a file called setup.py with the argument install. The sudo command at the beginning gives python permission to the files outside of your individual file space -- it will ask you for your password before running the rest of the command.
~> sudo python setup.py install passwd: running install running build ... copying build/lib/fpconst.py -> /Library/.../2.4/lib/python2.4/site-packages byte-compiling /Library/.../2.4/lib/python2.4/site-packages/fpconst.py to fpconst.pyc
A similar manual installation process is required for SOAPpy. We are using SOAPpy 0.12_rc1 which is available from the Web Services for Python download page.
Unfortunately, SOAPpy hasn't been updated for a couple of years and Python 2.5 now catches some errors which were previously ignored, so you will need to download and install our updated version.
You then repeat the installation process used for fpconst: unzip the file and run sudo python setup.py install inside the unpacked directory.
Once SOAPpy and fpconst are installed you should be able to go:
>>> import fpconst >>> import SOAPpy
in the interactive Python interpreter and it should not return an error message.
2.6 MySQLdb (MySQL client library)
We are using the MySQL database in the course. To access the database server from within Python you need the MySQLdb module installed.
The module source code can be downloaded from here and compiled if you already have MySQL installed. However, this is a popular module and is most likely to be already supported by the package managers for your Linux distribution.
2.6 IPython (improved interactive interpreter)
IPython is an improved Python interactive interpreter. For the Linux installation you need to download the gzipped tar file of source for this module from here and then install it manually (like fpconst and SOAPpy).
The following instructions will build and install IPython from the tar file:
~> tar -xvzf ipython-0.8.2.tar.gz ... ~> cd ipython-0.8.2 ~> sudo python setup.py install passwd: ...
Once the build and installation process has been completed you should be able to run ipython from a Terminal window:
~> ipython Python 2.5.1 (r251:54863, Oct 5 2007, 13:36:32) Type "copyright", "credits" or "license" for more information. IPython 0.8.1 -- An enhanced Interactive Python. ? -> Introduction to IPython's features. %magic -> Information about IPython's 'magic' % functions. help -> Python's own help system. object? -> Details about 'object'. ?object also works, ?? prints more. In [1]:
Summary of the Python module files to install
If you download and run these you will have everything above:
- NumPy 1.0.1
- SciPy 0.5.2
- matplotlib 0.90.0
- MySQLdb 1.2.1_p2
- fpconst 0.7.3
- our updated version of SOAPpy 0.12.0
- IPython 0.8.2
3. MySQL (MySQL database server)
As well as installing the MySQLdb client library for Python (above) you also need to install the MySQL server itself. We will be using the Open Source community server version 5.0.51a available from here.
There are separate downloads for a large variety of Linux distributions on this page but again most package managers will have recent enough versions (>= 5.0) of MySQL already available within the distribution.
4. Subversion (version control tools)
We will be using subversion 1.4.6 (the latest) which will most definitely be supported by Linux package managers. The package will either be called subversion, or perhaps abbreviated to svn.
5. Bash shell/Unix tools
Linux comes with all of the tools we need already! The only problem might be that your default shell is tcsh rather than bash.
6. Java runtime environment
The most recent releases of the Java runtime environment for Linux are available from here in either RPM or gzipped tar format.
7. Aladin (VO-enabled Sky Atlas)
We are using
Aladin version 5 which can be downloaded from the Aladin stand-alone download page. There are a variety of different versions plus a jar file (labelled as piece by piece). We need to use the jar version because we need to set the web proxy before Aladin loads. Please download the three jar files: Aladin.jar.
We will explain how to run it during the summer school.
