Setting up the Python environment

All code samples in this guide are written in Python (version 3.7). A basic knowledge of Python is required. Python is chosen because it is a simple, self-explanatory, easy-to-start, and a widely used language. If you are not familiar with this language, it will not be difficult to understand the code in this guide. A great way to start with Python is to follow its tutorial.

To set up the Python environment in Windows

  1. Download the installer for the latest version of Python 3.

  2. Run the installer.

  3. Select Add Python 3.x to PATH.

  4. Click Install Now.

    The installer installs Python and pip (a tool for installing and managing Python packages locally) in your user folder and adds folders with Python executables to your user path.

  5. Start the command line.

  6. Install the requests package that is required for sending requests to the API:

    pip install requests
    

To set up the Python environment in Mac OS X

  1. Start the terminal.

  2. Install Python 3 and pip (a tool for installing and managing Python packages locally).

  3. Install the requests package that is required for sending requests to the API:

    pip install requests
    

To set up the Python environment in Linux

  1. Start the terminal.

  2. Check if Python 3 is already installed:

    python --version
    

    If Python 3 is not installed, install it via your distribution’s package manager. The command and package names vary.

    • In Debian and derivatives such as Ubuntu, use apt:

      sudo apt-get install python3
      
    • In Red Hat and derivatives, use yum:

      sudo yum install python3
      
    • In SUSE and derivatives, use zypper:

      sudo zypper install python3
      
  3. Install pip (a tool for installing and managing Python packages locally).

  4. Install the requests package that is required for sending requests to the API:

    pip install requests