Installing the SDK

This article describes the SDK installation process. It contains the following sections:

How to Acquire a Copy of the SDK

At present, consult with your Sight Machine Engagement Team on how to acquire a copy of the Sight Machine SDK.

Checking Python Version Compatibility

Python 3.7 is recommended. The SDK is compatible with Python versions 2.7, 3.5, 3.6, and 3.7.

Installing the SDK

The installation process involves two steps:

  1. Setting up the SDK (installing from either the source or a package).
  2. Confirming that you installed the SDK and its dependencies properly.
Step Command

Installing the SDK from source:

pip install -r requirements.txt
python install

Installing the SDK from a package:

pip install <filename>.whl


import sightmachinesdk as sm


Contact your Sight Machine Engagement Team to request credentials. If you are able to log in to your environment with an email address and password, use these credentials with basic mode below. If Single Sign On (SSO) is enabled for your environment, please contact Sight Machine to request an API key.

To authenticate:

  1. Initialize a Client:
  2. cli = sm.Client('<tenantname>', auto_login=False)
  3. Log in using the method provided by Sight Machine:
  4. cli.login('basic', email='<>', password='<password>')
    cli.login('apikey', key='<apikey>')

NOTE: An up-to-date SSL client, such as OpenSSL, must be installed locally on the machine that is running the SDK. Otherwise, an SSL error will likely occur when authenticating with the SDK Client.

Hello World Example

This minimal example allows you to confirm that you installed the SDK and dependencies correctly. It produces a visualization for a simple dataframe.

import sightmachinesdk as sm
import pandas as pd
import plotly.graph_objs as go
from plotly.offline import init_notebook_mode, iplot

cli = sm.Client('<tenantname>', auto_login=False)

df = pd.DataFrame({
   'a': [0, 0, 1, 2, 1, 3, 2, 3, 4, 4],
   'b': [2, 1, 0, 0, 1, 1, 2, 3, 2, 1],
   'c': ['q', 'r', 'q', 'q', 'r', 'q', 'r', 'r', 'r', 'q']

plt = cli.get_plot('line', df)

If you run into any errors, see Reference Information for more details.