Installing P4 API for Python

Before installing P4 API for Python, any previously installed versions should be uninstalled.

In this section:

Install P4 API for Python using pip

As of P4 API for Python 2015.1, the recommended mechanism for installing P4 API for Python is via pip. For example:

pip install p4python

pip installs binary versions of P4 API for Python where possible, otherwise it attempts to automatically build P4 API for Python from source. For instruction on building P4 API for Python from source, see the Building P4 API for Python from Source section of the P4 API for Python Release notes.

When P4 API for Python is built without the --apidir option, setup attempts to connect to the Perforce website to download the correct version of the P4 API for C/C++ binary. If the P4 API for C/C++ download is successful, it is unpacked into a temporary directory.

Linux: when P4 API for Python is built without the --ssl option, setup.py looks at the installed OpenSSL and checks to see if it is a supported version.

P4 API for Python 2019.1 and later: OpenSSL libraries are REQUIRED, version 1.0.2+ or version 1.1.1+. If a supported version of OpenSSL is not found, setup.py will download and install one from ftp.openssl.org.

Install P4 API for Python from a package

  1. Configure the Perforce package repository.

    As root, follow the instructions for your OS distribution:

  2. Import the Perforce package signing key.

    Follow the instructions for your OS distribution:

    For information about how to verify the authenticity of the signing key, see the Perforce website

  3. Install the P4 API for Python package on the server hosting the P4 Server.

    Follow the instructions for your OS distribution: