Before installing PyRAF in Ubuntu you need to check if you have the following programs installed:

Package Tested with
IRAF 2.14 on Ubuntu
STSDAS/TABLES 3.10
Python 2.5.4, 2.7.1
Tcl/TK 8.5.7
Pmw 1.3.2
urwid 0.9.9.1 (optional)
ipython 0.10.1 (optional)
NumPy 1.5.1
GNU readline 6.1

To install IRAF with STSDAS and TABLES I would highly recommend you follow these instructions. The rest of the stuff you can get using either the Ubuntu Software Center or the Synaptic Package Manager.

To test if you have all got it working try loading the programs:


python
>>> import readline
>>> import Tkinter
>>> Tkinter._test()
>>> import Pmw

If you do not get an ImportError it means that Tcl, Tk, Readline, Python and Pmw are installed on the system.

Download PyRAF (stsci_python). PyRAF comes as part of stsci_python.

Go to the installation directory where you have IRAF installed:


cd /iraf/iraf

Move the downloaded fie to /iraf/iraf. Change user with your username:


sudo cp /home/user/Downloads/stsci_python_2.11.tar.gz .
tar -zxf stsci_python_2.11.tar.gz
rm stsci_python_2.11.tar.gz
cd stsci_python_2.11

Install the stsci_python package:


sudo python setup.py install

You might find that you run into the following error:

pytools.irafglobals.IrafError: Attempt to set unknown lone parameter dp

This is due to a typo in iraf/unix/hlib/extpkg.cl. To fix it, you will need to change line 23 in that file (within your 2.15 IRAF installation) from:

dp = mktemp (“tmp$dpkg”)

to this:

dpkg = mktemp (“tmp$dpkg”)

Then PyRAF should start up as usual.