These instructions are for users who have all required supporting packages present on their systems, and their python installation already works with all those required modules enabled. In other words, the stand-alone PyRAF installation is for those users who know what they are doing. To install all of stsci_python instead, go here or, for older versions, go here.
There are two methods described below since you may either install via "setup.py" or via "pip".
Instructions using "setup.py"
To install the stand-alone PyRAF build, download and then unpack the source distribution file in some temporary area on disk. PyRAF requires the packages d2to1, stsci.distutils, and stsci.tools from stsci_python, so they have been included for you in the tar file.
- gunzip pyraf-n.m.tar.gz
- tar xvf pyraf-n.m.tar
- cd pyraf-n.m/required_pkgs/d2to1
- python setup.py install # this installs d2to1
- cd ../stsci.tools
- python setup.py install # this installs stsci.tools
- cd ../..
- python setup.py install # this installs pyraf
This will install d2to1 and stsci.tools and then PyRAF into the Python installation found in your PATH. The process may also require the package "distribute" (and possibly other installer-related packages), but if so, the installation should automatically download and install them for you.
If you have multiple installations of Python on your machine, use the fully qualified pathname to the python executable above in place of "python".
Also see:
python setup.py --help
Instructions using "pip"
To install the stand-alone PyRAF build (and all of its requirements) via "pip", you will first need to install "pip" itself, though be aware that our installation process via pip is new (as of May 2013) and we are still working out some kinks.
- pip install pyraf
This will install stsci.tools and then PyRAF into the Python installation found in your PATH, or the one associated with the version of pip found on your PATH. This will require internet access.
If you have multiple installations of Python on your machine, use the fully qualified pathname to the correct pip executable above in place of "pip".
Also see:
pip --help
Personal Install
If you are installing using the "--home" arg (e.g. you do not have permission to install to your Python installation area), the directions are similar. Use the install command:
python setup.py install --home='/home/bob/my_installs'
But make sure you also set your PYTHONPATH to point to "/home/bob/my_installs/lib/python". This will need to be done before the actual install of PyRAF since it uses stsci.tools during installation.
You may also want to try using Virtualenv (www.virtualenv.org)
Python 3
If you are installing the Python-3-supporting version of PyRAF (and you have downloaded the appropriate file), you will not need to do anything special or run the 2to3 tool - this has already been done for you. Simply install as listed above.
Other Packages
If you wish to perform manual installations of other STScI software packages as you have done above with PyRAF, you may download any parts you need at:
and instructions on manual installation are here.
Assistance
If you have any difficulties with the installation of any of the packages in stsci_python, or even if you just have questions or suggestions, please do not hesitate to contact us at help@stsci.edu.