![]() |
|
||||||||||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||||||||||||||
|
|
|
Some platforms have most of these packages already installed in their system directories. To test whether your Python installation has all modules needed, start Python and try to import them: % python >>> import readline >>> import Tkinter >>> Tkinter._test() >>> import Pmw If you don't get an ImportError, this means that Tcl, Tk, Readline, Python and Pmw are already installed on the system. The X11 windowing system and a C compiler are needed as well. Follow the directions on http://iraf.noao.edu/ to get IRAF working on your system. To facilitate installations, Numpy is included in the stsci_python distribution. Some NumPy documentation is available at http://www.scipy.org/Documentation Remove Any Old STSCI_PYTHONIf you have an earlier version of STSCI_PYTHON installed, you should either remove it or ensure that it is not present on your PYTHONPATH.Python does not have a facility to uninstall packages, but you can use the uninstall.py script to assist you. It attempts to locate things that look like they might be part of a previous stsci_python installation. For each thing that uninstall.py locates, it will describe it and then offer to delete it for you. If you want to delete it, type "y" and press enter. If you want to skip it, just press enter.
For a personal install, the files are installed in a directory that you choose, instead of in the system directories. For example, if you install in /home/user/stuff, the package files will be under /home/user/stuff/lib/python and the pyraf program will be in /home/user/stuff/bin.
You will need this set of commands to set up the environment. Other users can also run from your copy of the software by setting the environment variables to point to the same directories. Enter these commands now, and also place them in your .login or .cshrc file: set d=$HOME/stuff setenv PYTHONPATH $d/lib/python set path = ( $d/bin $path ) To install stsci_python, you must unset these environment variables that were set by IRAF: % unsetenv F77 % unsetenv F2C Extract the tar file: % gunzip stsci_python_2.7.tar.gz % tar -xvf stsci_python_2.7.tar use gtar (gnu tar) on Solaris % cd stsci_python_2.7 If you need numpy, install it: % cd numpy-1.1.0 % python setup.py install --home=$d % cd .. Install the stsci_python package: % python setup.py install --home=$d (optional) Install the stsci_python documentation: % cd stscidocs % python setup.py install --home=$d If you are root, you can install stsci_python in the system python directories, where it will be available to all users. The commands are almost the same as for a personal install, but you do not need to specify the directory to install. To install stsci_python, you must unset these environment variables that were set by IRAF: % unsetenv F77 % unsetenv F2C Extract the tar file: % gunzip stsci_python_2.7.tar.gz % tar -xvf stsci_python_2.7.tar use gtar (gnu tar) on Solaris % cd stsci_python_2.7 If you need numpy, install it: % cd numpy-1.1.0 % python setup.py install % cd .. Install the stsci_python package: % python setup.py install (optional) Install the stsci_python documentation: % cd stscidocs % python setup.py install Testing the InstallationThe script testpk.py can be used to check the integrity and version compatibility of the installation.Note: This script must be run from a directory other than stsci_python, for example your home directory. Make sure that $PYTHONPATH is correct. % cp testpk.py ~ % cd % python testpk.py Installing BinariesMacintoshUninstalling an old installation
If you have installed the package from a previous release, there is no need to uninstall it. When you install the new package, it will remove the old software and replace it.
The Macintosh binaries are distributed as a Macintosh package. This package includes all of - IRAF - STSDAS/TABLES - Python and supporting code - STSCI_PYTHON in a single package. This is the same package that we use internally at the Institute. You must be an administrator to install this package. Download the appropriate DMG file from http://www.stsci.edu/resources/software_hardware/pyraf/stsci_python/current/download . Pick the PPC file if you have a PowerPC based Macintosh, or the Intel file if you have an Intel based Macintosh. Double-click on the .dmg file, then double-click on the .pkg file in the window that appears. This runs the standard Macintosh installer. Click "Continue" to move through the various screens of the install and enter your password when prompted. Most of the package is installed in /usr/stsci. IRAF assumes that there is only one IRAF installation on any computer and it places symlinks at various places about the system. There may be some conflict if you have multiple copies of IRAF installed, but 2.12, 2.13, and 2.14 appear to be similar enough that it is not a great problem unless you are compiling IRAF itself from source code. Warning: This package and future releases will attempt to remove any previously installed copies of itself. That means that changes to the software in /usr/stsci will be lost if you run the installer again. We strongly suggest that you do not make changes to the software in /usr/stsci. Notably, add new IRAF tasks by editing your login.cl file and install python packages with --home or --prefix. User Configuration Because of certain IRAF dependencies, you must use csh as your shell. The default on OSX is bash. To change it, type: chsh -s /bin/tcsh Each user who wants to use the software from this package must execute these two commands: source /usr/stsci/envconfig.mac/cshrc iraf We suggest that you place these commands at the end of your .cshrc file. There are many environment variables involved, and you may have problems if you override their values. Note: This package is essentially the same thing that we use internally at STScI. If you examine the script file, you will find aliases for "irafx" and "irafdev". These are test configurations that we use internally; they are not distributed with this package. WindowsThe Windows binaries are distributed as a Windows installer file. It is available from http://www.stsci.edu/resources/software_hardware/pyraf/stsci_python/current/downloadDownload the .exe file and double-click on it to install it. Running PyRAFTo run PyRAF, enter the commandpyraf A PyRAF tutorial is available at http://stsdas.stsci.edu/pyraf/doc.old/pyraf_tutorial/ Note: PyRAF is heavily dependent on IRAF, therefore does not work on MS Windows. AssistanceIf you have any difficulties with the installation of any of the packages in stsci_python, please do not hesitate to contact us for assistance. Also, if you have questions or suggestions about stsci_python in general or this document contact us at help@stsci.edu. We hope that people can contribute tips to the platform specific part of this document.- Iraf and stsci_python need X11 and will NOT work with the version of python distributed with the operating system (/usr/bin/python) or with macpython. X11 based versions of Tcl/Tk and Python are required. - On MacOSX the installation was tested with the supporting packages installed from sources on the Unix command line, but installations of the supporting packages can be done using fink ( http://fink.sourceforge.net/ ). Some of the packages don't have binaries available from fink. Python MUST be installed from source using fink, in order to get Tkinter working. If fink was used for installations of supporting packages on MacOSX, make sure you are running python in /sw/bin when you attempt to install stsci_python. - Compilers can be installed with the Developer's tools. Linux- Problems runnning graphics tasks in Pyraf were reported on some operating systems (for example Ubuntu and Suse). The errror message is TclError: expected floating point number but got "1.0" Although we do not understand the reasons for this we know it is caused by a default non-english locale on the system. One possible solution is to start pyraf by running: env LC_ALL=C pyraf Some of the packages require IRAF to be present on the system. IRAF installation is not discussed in this document. IRAF is maintained by the iraf group at NOAO. For installation instructions or problems, see http://www.iraf.net. Note: A full installation of the supporting packages is needed, including libraries and header files. On some operating systems the header files may be in a separate package. For example on Redhat they are in the corresponding "devel" rpm package. If installation from source is necessary, on most systems the following will work: To unpack a source file: % gunzip package.tar.gz % tar -xvf package.tar ยท To configure and build a package: % cd package % ./configure --prefix=<installation-directory> % make % make install This will create directories bin, lib, include under <installation-directory>. The option "--prefix=" in the above "./configure" command may be omitted for installations in /usr/local. If you install any of these packages in a personal directory, you will most likely need to change two environment variables: % setenv LD_LIBRARY_PATH <installation-directory>/lib:$LD_LIBRARY_PATH % setenv PATH <installation-directory>/bin:$PATH or set them % setenv LD_LIBRARY_PATH <installation-directory>/lib % setenv PATH <installation-directory>/bin Tcl/TkIf you have to build these packages from source, build them as shared libraries. On most systems the following set of commands will work for Tcl and Tk: % cd tcl8.3.5/unix % ./configure --enable-shared --prefix=<installation-directory> % make % make install ReadlineReadline is probably already installed on your system. Make sure the header files are installed as well. A possible location to look for them is /usr/include/readline. In case you need to install Readline in your personal directories, the following commands will install it on most systems:% cd readline % ./configure --prefix=<installation-directory> % make % make install Python% cd python % ./configure --prefix=<installation-directory> % make % make install To test whether your Python installation has all required modules enabled, try to import the modules as described in Section 1.0. To build Tkinter, you may need to edit the file Modules/Setup in the Python source distribution, to let Python know where Tcl/Tk and X11 libraries are. Below is an example of this section of the Setup file on Solaris. Note, that some lines are uncommented and the paths on your system may be different. # The _tkinter module. # # The command for _tkinter is long and site specific. Please # uncomment and/or edit those parts as indicated. If you don't have a # specific extension (e.g. Tix or BLT), leave the corresponding line # commented out. (Leave the trailing backslashes in! If you # experience strange errors, you may want to join all uncommented # lines and remove the backslashes -- the backslash interpretation is # done by the shell's "read" command and it may not be implemented on # every system. # *** Always uncomment this (leave the leading underscore in!): _tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \ # *** Uncomment and edit to reflect where your Tcl/Tk libraries are: -L/usr/local/lib \ # *** Uncomment and edit to reflect where your Tcl/Tk headers are: -I/usr/local/include \ # *** Uncomment and edit to reflect where your X11 header files are: # -I/usr/X11R6/include \ # *** Or uncomment this for Solaris: -I/usr/openwin/include \ # *** Uncomment and edit for Tix extension only: # -DWITH_TIX -ltix8.1.8.2 \ # *** Uncomment and edit for BLT extension only: # -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \ # *** Uncomment and edit for PIL (TkImaging) extension only: # (See http://www.pythonware.com/products/pil/ for more info) # -DWITH_PIL -I../Extensions/Imaging/libImaging tkImaging.c \ # *** Uncomment and edit for TOGL extension only: # -DWITH_TOGL togl.c \ # *** Uncomment and edit to reflect your Tcl/Tk versions: -ltk8.3 -ltcl8.3 \ # *** Uncomment and edit to reflect where your X11 libraries are: # -L/usr/X11R6/lib \ # *** Or uncomment this for Solaris: -L/usr/openwin/lib \ # *** Uncomment these for TOGL extension only: # -lGL -lGLU -lXext -lXmu \ # *** Uncomment for AIX \ # -lld \ # *** Always uncomment this; X11 libraries to link with: -lX11 libf2cUrwid
Urwid ( http://excess.org/urwid/ ) can be installed optionally. It is needed for support of tpar (a text based epar) in PyRAF. It can be installed by :
% python setup.py install Ipython
Ipython ( http://ipython.scipy.org/moin/ ) can be installed optionally as well. If available PyRAF can run in the Ipython interpreter (pyraf --ipython). To install Ipython, execute the command:
% python setup.py install
|
| |
|||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||