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 ftp.perforce.com 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 on Windows
Windows users can download an installer containing pre-built packages for P4Python from the Perforce web site at https://www.perforce.com/downloads/helix-core-api-python.
Install P4Python from a package
-
Configure the Perforce package repository.
As root, follow the instructions for your OS distribution:
-
Ubuntu 16.04:
Create the file
/etc/apt/sources.list.d/perforce.list
with the following content:$ deb http://package.perforce.com/apt/ubuntu/ xenial release
-
Ubuntu 18.04:
Create the file
/etc/apt/sources.list.d/perforce.list
with the following content:$ deb http://package.perforce.com/apt/ubuntu/ bionic release
-
CentOS/RHEL 6:
Create the file
/etc/yum.repos.d/perforce.repo
with the following content:[Perforce]
name=Perforce
baseurl=http://package.perforce.com/yum/rhel/6/x86_64/
enabled=1
gpgcheck=1 -
CentOS/RHEL 7:
Create the file
/etc/yum.repos.d/perforce.repo
with the following content:[Perforce]
name=Perforce
baseurl=http://package.perforce.com/yum/rhel/7/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
-
CentOS/RHEL (run this command as root):
# 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 server.
Follow the instructions for your OS distribution:
-
Ubuntu
Install the correct package for the version of Python that you are using, for example:
$ sudo apt install perforce-p4python
or
$ sudo apt install perforce-p4python3
-
CentOS/RHEL (run the command as root):
Install the package using:
# sudo yum install perforce-p4python
-
Your search for returned result(s).