PyCharm Setup Instructions

PyCharm is a Python IDE created by JetBrains.

Table of Contents

Prerequisites

These instructions assume you have already installed:

  • Python 2.7.
  • Trusted Analytics Platform Python REST Client and required dependencies.
  • PyCharm.

Trusted Analytics Platform should work with any version of PyCharm but these instructions were tested with PyCharm Community Edition 3.4.1.

Setup

  1. Select New Project on PyCharm’s initial screen.

    1. Give your project a name, for example, “myproject”.
    2. Choose Python 2.7 as the Python Interpreter and choose the OK button.
      1. If Python 2.7 does not appear in the list you will need to configure a Python 2.7 interpreter.
        1. Choose the button that looks like a “gear”.
        2. Choose Add Local.
        3. Browse for your local Python 2.7 installation. On RedHat or CentOS this is probably /usr/bin/python.
        4. Choose the OK button.
  2. Choose File ‣ Settings.

    1. Choose Project Structure.
    2. Choose Add Content Root and browse to the Trusted Analytics Platform Python REST Client libraries. On RedHat or CentOS these are found under ‘/usr/lib/trustedanalytics/rest-client/python’.
    3. Choose Apply button.
    4. Choose OK button.
  3. Right click your project folder, for example, “myproject”, and select New ‣ Python File.

    1. Name the file “test” and type in the following code:

      import trustedanalytics as ta
      ta.server.host = "correct host name or IP address"
      ta.connect()
      ta.server.ping()
      
    2. If you see a yellow bar across the top of the file warning about “Package requirements” not being satisfied then your system is not setup correctly.

      1. You may not have installed all of the Python dependencies for the Trusted Analytics Platform REST Client correctly.
      2. You may have chosen the wrong Python interpreter.
  4. Choose Run ‣ Run, you should see the output:

    Successful ping to Trusted Analytics ATK at http://localhost:9099/info
    
  5. Next take a look at the included examples.