Installing P4Python
Before installing P4Python, any previously installed versions should be uninstalled.
In this section:
Install P4Python using pip
As of
P4Python
2015.1, the recommended mechanism for installing
P4Python
is via pip
. For example:
pip install p4python
pip installs binary versions of P4Python where possible, otherwise it attempts to automatically build P4Python from source. For instruction on building P4Python from source, see the Building P4Python from Source section of the P4Python Release notes.
When P4Python is built without the --apidir option, setup attempts to connect to the Perforce website to download the correct version of the P4API binary. If the P4API download is successful, it is unpacked into a temporary directory.
Linux: when P4Python is built without the --ssl option, setup.py looks at the installed OpenSSL and checks to see if it is a supported version.
P4Python 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 P4Python from a package
-
Configure the Perforce package repository.
As root, follow the instructions for your OS distribution:
Ubuntu 20.04:Create the file
/etc/apt/sources.list.d/perforce.list
with the following content:deb http://package.perforce.com/apt/ubuntu/ focal release
Ubuntu 22.04:Create the file
/etc/apt/sources.list.d/perforce.list
with the following content:deb http://package.perforce.com/apt/ubuntu/ jammy release
RHEL 8/Rocky Linux 8:Create the file
/etc/yum.repos.d/perforce.repo
with the following content:[Perforce]
name=Perforce
baseurl=http://package.perforce.com/yum/rhel/8/x86_64/
enabled=1
gpgcheck=1RHEL 9/Rocky Linux 9:Create the file
/etc/yum.repos.d/perforce.repo
with the following content:[Perforce]
name=Perforce
baseurl=http://package.perforce.com/yum/rhel/9/x86_64/
enabled=1
gpgcheck=1 -
Import the Perforce package signing key.
Follow the instructions for your OS distribution:
Ubuntu:wget -qO - https://package.perforce.com/perforce.pubkey | sudo apt-key add -
sudo apt-get update
RHEL/Rocky Linux:sudo rpm --import https://package.perforce.com/perforce.pubkey
For information about how to verify the authenticity of the signing key, see: https://www.perforce.com/perforce-packages
-
Install the P4Python package on the server hosting the Helix Core Server.
Follow the instructions for your OS distribution:
Ubuntu:Install the correct package for the version of Python that you are using, for example:
For an OS default Python3 version:
sudo apt install perforce-p4python3
or
For a specific version supported by the OS:
sudo apt install perforce-p4python3-python3.10
sudo apt install perforce-p4python3-python3.9
RHEL/Rocky Linux:Install the correct package for the version of Python that you are using, for example:
For an OS default Python3 version:
sudo yum install perforce-p4python3
or
For a specific version supported by the OS:
sudo yum install perforce-p4python3-python3.8
sudo yum install perforce-p4python3-python3.9