Python Dependency Installation for Mac OS X

This document describes how to install the Python dependencies for the Inspect Tool contained in the inspect package on the Mac OS X platform.

Mac Ports

This installation procedure requires Mac Ports to be installed on the target computer. Download the installer for your version of Mac OS X from the Mac Ports installation page. Mac Ports in turn requires Xcode and the Xcode command-line tools to be installed on the target computer. The above page provides a link to those instructions. Once Xcode is installed and/or verified, download the Mac Ports package and follow the instructions provided once you double-click the package file. Once Mac Ports is installed successfully, perform the following command to update the port files:

% sudo port -v selfupdate          
        

Python Package

The first step is to verify the version of Python on the target computer. As stated in the Installation document, version 2.7.8 or above is recommended. In this case below, version 2.7.10 was installed but the OpenSSL package was out of date, requiring an upgrade to the Python package:

% python -V
Python 2.7.10

% python -c "import ssl; print(ssl.OPENSSL_VERSION)"
OpenSSL 0.9.8zh 14 Jan 2016
        

The version of OpenSSL should be 1.0.X in order to avoid other issues that will show up once you start installing the rest of the packages. If the Python version and OpenSSL version meet the requirements, you may skip the Python installation that follows. Otherwise, install the latest version of Python 2.7.X with the following commands:

% sudo port install python27
% sudo port select --set python python27
        

For a recent installation on a Mac with OS X "Sierra", the above commands resulted with the following versions being installed:

% python -V
Python 2.7.15

% python -c "import ssl; print(ssl.OPENSSL_VERSION)"
OpenSSL 1.0.2o  27 Mar 2018
        

Dependencies

Once Mac Ports has been installed and the Python package updated, install pip, PyQt, matplotlib and seaborn and their dependencies with the following commands:

% sudo port install py27-pip
% sudo port select --set pip pip27
% sudo port install qt4-mac
% sudo port install py-pyqt4
% sudo port install py-tkinter
% sudo pip install matplotlib
% sudo pip install seaborn
        

With the above dependencies installed, install the PDS4 Tools package. The package is available from the Python PDS4 Tools page. Once the package is downloaded, install it with the following command (replacing X.X with the appropriate version):

% sudo pip install PDS4_tools-X.X.zip
        

With successful installation of the PDS4 Tools package, the target computer should support execution of the Inspect Tool.