View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum ↗

ascl:1207.011 GitHub release PyRAF CI test Documentation Status


PyRAF is a command language for IRAF based on the Python scripting language that can be used in place of the existing IRAF CL. It allows such things as importing Python modules, starting in any directory, GUI parameter editing and help. It can be imported into Python allowing you to run IRAF commands from within a larger script.

PyRAF was developed since 1999 at the Space Telescope Science Institute (STScI). Development and Support were stopped in 2019. Further maintainance will be in the framework of the IRAF Community.


The PyRAF package is maintained on Github. The preferred way to report a bug is to create a new issue on the pyraf GitHub issue page. To contribute patches, we suggest to create a pull request on GitHub.


To install PyRAF, it is required to have both IRAF and Python 3 already installed. Both a self-compiled and a binary IRAF package (f.e. in Ubuntu) will work.

The IRAF installation should have a properly configured environment, especially the iraf environment variable must be set to point to the IRAF installation directory (i.e. to /usr/lib/iraf/ on Ubuntu or Debian systems). On multi-arch IRAF installations, the IRAFARCH environment variable should specify the architecture to use. This is usually already set during the IRAF installation procedure.

The minimal Python required for PyRAF is 3.6, but it is recommended to use the latest available version. An installation in an virtual environment like venv or conda is possible.

On some Linux distributions, PyRAF is readily available as a binary package and can be installed with the package installer, like sudo apt install python3-pyraf on Debian or Ubuntu. On all other systems, the package can be installed via PyPI with the command pip3 install pyraf. Note that if no binary installation is available on PyPI, the package requires a compilation, so aside from pip3, the C compiler and development libraries should be installed.