Python Dependency Installation for General Platform

This document describes how to install the Python dependencies for the Inspect Tool contained in the inspect package on a general platform.

Dependencies

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