Installation

This document describes how to install the Inspect Tool contained in the inspect package. The following topics can be found in this document:

System Requirements

This section details the system requirements for installing and operating the Inspect Tool software.

Python

The Inspect Tool software was developed using Python and will run on any platform with a supported Python environment. It is compatible with Python 2.6 or 2.7 (Python above 2.7.8 is recommended). It is not compatible with Python 2.5 or earlier versions; or currently with Python 3. The following commands test the local Python installation in a UNIX-based environment:

% which python
/usr/bin/python

% python --version
Python 2.7.12
        

The first command above checks whether the python executable is in the environment's path and the second command reports the version. If Python is not installed or the version is not 2.7 (python versions above 2.7.8 are recommended for easier installation of the Inspect Tool), Python will need to be downloaded and installed in the current environment. Consult the local system administrator for installation of this software on networked machines. Most systems should have both Python 2.7 and Python 3 installed. On local machines, current versions of python can be downloaded from Python download page

Python Dependencies

The Inspect Tool software has dependencies on a number of Python libraries. In the future the code will be make into a standalone executable. However for now, the following modules must be installed in order to run the Inspect Tool:

  • pds4_tools
  • Module and installation instruction found at Python PDS4 Tools

  • Qt (if not already installed on your machine)
  • Mac : % brew install qt or equivalent

    Windows : Installing Qt on a Windows machine.

    Linux : Installing Qt on a Linux machine.

    Qt download documentation : Download Qt.

  • PyQt4 and SIP (C++ to Python wrapper code (i.e. Qt to PyQt))
  • This is the most difficult installation; installation information is found at: PyQt4 and SIP instructions. There are possible errors and workarounds listed below. If you get stuck feel free to send an email to Installation Help.

  • Matplotlib
  • Required by Matplotlib and should be install along with Matplotlib: Installing Matplotlib

  • Numpy - required by Matplotlib
  • python-dateutil - required by Matplotlib
  • pytz - required by Matplotlib
  • cycler - required by Matplotlib
  • pyparsing - required by Matplotlib

pip is a package management system used to install and manage python software packages. It is included in python versions 2.7.9 onward. It is very easy to use: How to use pip. It can be used install all of the packages listed above with the exception of PyQt4 and SIP. If you are not sure if you have pip installed on your machine do the following:

% which pip  (from Mac or linux)  
% where pip  (Windows in a command prompt window)
or
% python
>>> import pip  (Note: The import command can be used to test for installation of the other packages listed above.) 
        

Example of using pip and checking for a successful installation.

                
% pip install matplotlib
% python
>>> import matplotlib 
>>>

        

Possible Problems with PyQt4 Installation

Listed below are workarounds for error messages that may pop up

  • When running : % python configure-ng.py
  • Querying qmake about your Qt installation... Determining the details of your Qt installation... This is the GPL version of PyQt 4.12.1 (licensed under the GNU General Public License) for Python 2.7.14 on darwin. Error: This version of PyQt4 and the commercial version of Qt have incompatible licenses."

  • Workaround
  • Make the following changes to the configure-ng.py script

    comment out the following lines:

    # if introspecting and target_config.qt_licensee not in OPEN_SOURCE_LICENSEES and ltype == 'GPL':

    # error(=

    # "This version of PyQt4 and the commercial version of Qt have "

    # "incompatible licenses.”)

  • Try running the Inspect Tool again:
  • You may get the following error:

    RuntimeError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more information on installing Python as a framework on Mac OS X. Please either reinstall Python as a framework, or try one of the other backends. If you are using (Ana)Conda please install python.app and replace the use of 'python' with 'pythonw'. See 'Working with Matplotlib on OSX' in the Matplotlib FAQ for more information.

    If so try the following steps:

  • Add the CXXFLAGS=-std=c++ environment variable before running configure-ng.py again.
  • Make sure the backend setting is set for PyQt4 in matplotlib:
  • backend:qt4agg in ~/.matplotlib/matplotlibrc
  • Unpacking the Package

    Download the inspect package from the PDS FTP site. The distribution is available in identical zip or tar/gzip packages. The installation directory may vary from environment to environment but in UNIX-based environments it is typical to install software packages in the /usr/local directory and in Windows-based environments it is typical to install software packages in the C:\Program Files directory. Unpack the selected binary distribution file in the installation directory for the local environment with one of the following commands:

    
    % unzip inspect-0.2.0-bin.zip
    or
    % tar -xzvf inspect-0.2.0-bin.tar.gz
          

    Note: Depending on the platform, the native version of tar may produce an error when attempting to unpack the distribution file because many of the file paths are greater than 100 characters. If available, the GNU version of tar will resolve this problem. If that is not available or cannot be installed, the zipped package will work just fine in a UNIX environment.

    The commands above result in the creation of the inspect-0.2.0 directory with the following directory structure:

    • README.txt

      A README file directing the user to the available documentation for the project.

    • LICENSE.txt

      The copyright notice from the California Institute of Technology detailing the restrictions regarding the use and distribution of this software. Although the license is strictly worded, the software has been classified as Technology and Software Publicly Available (TSPA) and is available for anyone to download and use.

    • bin/

      This directory contains Python scripts for launching and interacting with the software for UNIX-based and Windows environments.

    • doc/

      This directory contains a local web site with the Inspect Tool documentation and other configuration management related information. Just point the desired web browser to the index.html file in this directory.

    Configuring the Environment

    In order to manage and interact with the program-name, the local environment must first be configured appropriately. This section describes how to setup the user environment on UNIX-based and Windows machines.

    UNIX-Based Environment

    This section details the environment setup for UNIX-based machines. The binary distribution includes a few shell scripts that must be executed from the command-line. Setting the PATH environment variable to the location of the scripts, enables the shell scripts to be executed from any location on the local machine.

    The following command demonstrates how to set the PATH environment variable (in Bourne shell), by appending to its current setting:

    % export PATH=${PATH}:/usr/local/inspect-0.2.0/bin
            

    Windows Environment

    This section details the environment setup for Windows machines. The binary distribution includes a few batch scripts that must be executed from the command-line. Setting the PATH environment variable to the location of the files, enables the batch scripts to be executed from any location on the local machine.

    The following command demonstrates how to set the PATH environment variable, by appending to its current setting:

    C:\> set PATH = %PATH%;C:\Program Files\inspect-0.2.0\bin
            

    Additional methods for setting Windows environment variables can be found in the Windows System Properties document.