Install AppInspect on macOS

This topic includes details about installing the Splunk AppInspect Python-based package, including all required dependencies, on macOS.

Note: These instructions were tested on macOS Sierra (v10.12), but should also work in other versions of macOS and earlier versions of OS X.

This topic contains the following sections:

Install AppInspect in a virtualenv virtual environment

Splunk recommends using virtualenv to create a virtual environment in which to install and use AppInspect. Using virtualenv enables you to install AppInspect in an isolated Python environment, and to ensure you're using versions of AppInspect dependencies that have been tested and are known to work with AppInspect. You can also install AppInspect without using virtualenv; see Install AppInspect without using virtualenv for more information.

Install prerequisites

First, update or install the base Python dependencies for Splunk AppInspect: Homebrew, Xcode-Select, Python 2.7.x, and pip.

  1. Splunk recommends first installing the Homebrew package manager, which enables the brew command-line interface, and then updating Python 2.7. This is not required, but it is highly recommended to help make the rest of the install process easier. If Homebrew isn't currently installed, first install it. Open a Terminal window and enter the following command:

    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

    Verify Homebrew is installed by running the following command, which displays Homebrew's help content:

    $ brew
  2. Install LXML support. Run the following command to install Xcode-Select:

    $ xcode-select --install

    Verify Xcode-Select is installed by running the following command, which displays help content for Xcode-Select:

    $ xcode-select
  3. Install Python 2.7.x and Pip by running the following command:

    $ brew install python

    Verify Python is installed by entering the Python interactive shell:

    $ python

    Exit the interactive shell with the following command:

    $ exit()

Install virtualenv and create a virtual environment

Next, install virtualenv and create a virtual environment.

  1. Install virtualenv:

    $ [sudo] pip install virtualenv

    For more installation options, see Installation in virtualenv Installation.

  2. Create a new virtual environment by running the following command:

    $ virtualenv venv
    Note: venv is the name we've chosen to give to the directory where the virtual environment lives. You can use whatever name you want.

    For more information about creating a new virtual environment, see Usage in the virtualenv User Guide.

  3. Activate and enter the new virtual environment by running the following command:

    $ source venv/bin/activate

    For more information about activating virtualenv, see activate script in the virtualenv User Guide.

  4. Install AppInspect

    With the virtual environment activated, do the following to install Splunk AppInspect inside of it:

    1. Download the AppInspect installation tarball, but do not decompress it. To download AppInspect, you must first agree to the following:

      "By downloading AppInspect here, I hereby accept the terms of the Splunk Software License Agreement. This tool is published by Splunk but is not supported." To verify the integrity of the downloaded ZIP file:
    2. The following command installs all additional Python dependencies in the virtual environment and configures it so you can run splunk-appinspect. Be sure to replace <version> so that the name of the file matches the one you downloaded.

      (venv)$ [sudo] pip install splunk-appinspect-<version>.tar.gz
    3. Verify that AppInspect is installed by running the following command:

      (venv)$ splunk-appinspect --help

    Install AppInspect without using virtualenv

    If you prefer to run AppInspect without using a virtualenv virtual environment, do the following:

    Install prerequisites

    First, update or install the base Python dependencies for Splunk AppInspect: Homebrew, Xcode-Select, Python 2.7.x, and pip.

    1. Splunk recommends first installing the Homebrew package manager, which enables the brew command-line interface, and then updating Python 2.7. This is not required, but it is highly recommended to help make the rest of the install process easier. If Homebrew isn't currently installed, first install it. Open a Terminal window and enter the following command:

      $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

      Verify Homebrew is installed by running the following command, which displays Homebrew's help content:

      $ brew
    2. Install LXML support. Run the following command to install Xcode-Select:

      $ xcode-select --install

      Verify Xcode-Select is installed by running the following command, which displays help content for Xcode-Select:

      $ xcode-select
    3. Install Python 2.7.x and Pip by running the following command:

      $ brew install python

      Verify Python is installed by entering the Python interactive shell:

      $ python

      Exit the interactive shell with the following command:

      $ exit()

    Install AppInspect

    Next, install the AppInspect installation tarball.

    1. Download the AppInspect installation tarball, but do not decompress it. To download AppInspect, you must first agree to the following:

      "By downloading AppInspect here, I hereby accept the terms of the Splunk Software License Agreement. This tool is published by Splunk but is not supported."

      To verify the integrity of the downloaded ZIP file:

    2. The following command installs all additional Python dependencies and configures your system so you can run splunk-appinspect. Be sure to replace <version> so that the name of the file matches the one you downloaded.

      $ [sudo] pip install splunk-appinspect-<version>.tar.gz
    3. Verify that AppInspect is installed by running the following command:

      $ splunk-appinspect --help