Oracle Graph Python Client
You can install the Python client by downloading the oracle-graph-client-26.2.0.zip file that is shipped with Oracle Graph Server and Client or from PyPI.
Alternatively, you can also install the python client in embedded mode.
-
Installing the Python Client from PyPI
You can obtain the property graph Python client from PyPI. -
Upgrading the Python Client
This section describes how to upgrade the Python client. -
Installing the Python Client From the Graph Server and Client Downloads
You can download the zip file fororacle-graph-client-26.2.0from the Graph Server and Client downloads and install the Python client. -
Installing the Python Client in Embedded Mode
You can install and work with the Python client in embedded mode. -
Uninstalling the Python Client
This section describes how to uninstall the Python client.
Installing the Python Client from PyPI
You can obtain the property graph Python client from PyPI.
You can install the oracle-graph-client-26.2.0.zip package from the PyPI repository using pip.
Before installing the Python client from PyPI:
-
Ensure that your system meets the following requirements:
-
Supported operating systems: Linux, Windows, or macOS (M1 or M2 processor)
-
Supported JDK versions:
-
Oracle JDK 17 or JDK 21
-
OpenJDK JDK 17 or JDK 21
-
-
Supported Python versions: Python 3.10 or later
-
-
Ensure that you set the
JAVA_HOMEenvironment variable. -
If you are behind a firewall, then set the
https_proxyenvironment variable to the proxy server.
You can install and verify the Python client installation as shown:
-
Install the client through
pip.For example,
pip install --user oracle-graph-clientThis installs the Python client along with all the required dependencies.
-
Verify that your installation is successful.
$ python3 Python 3.12.11 (main, Aug 25 2025, 20:36:00) [GCC 8.5.0 20210514 (Red Hat 8.5.0-26.0.1)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import opg4py >>> import pypgxSee Also:
- Python API Reference for more information on the Python APIs.
Upgrading the Python Client
This section describes how to upgrade the Python client.
-
Review the available Python client versions and the currently installed version.
pip3 index versions oracle-graph-client WARNING: pip index is currently an experimental command. It may be removed/changed in a future release without prior warning. oracle-graph-client (23.3.0) Available versions: 23.3.0, 23.2.0, 23.1.0 INSTALLED: 23.1.0 LATEST: 23.3.0 -
Run the following command to upgrade your Python client.
pip3 install oracle-graph-client --upgrade
Installing the Python Client From the Graph Server and Client Downloads
You can download the zip file for oracle-graph-client-26.2.0 from the Graph Server and Client downloads and install the Python client.
Before you install the Python client:
-
System requirements:
-
Supported operating system: Linux
-
Supported JDK versions:
-
Oracle JDK 17 or JDK 21
-
OpenJDK JDK 17 or JDK 21
-
-
Supported Python versions: Python 3.10 or later.
To verify that you are using the right version of the Python client, run the following command:
python3 --versionFor more information on installing Python 3 on Oracle Linux, see Python for Oracle Linux.
-
Note: If you are using any other operating system or Python version, then you can install the Python client from PyPI. See Installing the Python Client from PyPI for more information.
-
Ensure that
python3-develis installed in your system.sudo yum install python3-devel
Note: See Python API Reference for more information on the Python APIs.
You can perform the following steps to install and connect using the Python client:
-
Download the Oracle Graph Client from Oracle Software Cloud.
For example,
oracle-graph-client-26.2.0.zip. -
Unzip the file into a directory of your choice.
The unzipped folder contains the
oracle-graph-python-client-26.2.0.zipfile for installing the Python client. -
Install the Python client by running the following command.
python3 oracle-graph-python-client-26.2.0.zip --user
-
Configure your client to trust the self-signed keystore. See Configuring a Client to Trust the Self-Signed Keystore for more information.
-
Start the OPG4Py shell to connect to the graph server(PGX) by running the following command:
cd <CLIENT_INSTALL_DIR> ./bin/opg4py --base_url https://<host>:7007In the preceding code:
-
<CLIENT_INSTALL_DIR>: Directory where the shell executables are located.
The shell executables are found in
<CLIENT_INSTALL_DIR>/binafter the client installation. -
<host>: Server host
Note: The graph server (PGX), listens on port
7007by default. If needed, you can configure the graph server to listen on a different port by changing the port value in the server configuration file (server.conf). See Configuring the Graph Server (PGX) for details.You are prompted to enter your username and password.
See Starting the OPG4Py Shell for more information on the different ways you can start the OPG4Py shell.
The OPG4Py shell starts and the following command line prompt appears as shown:
Oracle Graph Server Shell 26.2.0 >>>Note: You can also install the python client library in Jupyter Notebook. Using the Python API, you can then connect to the graph server (PGX) to run PGQL queries and graph algorithms in a Jupyter Notebook environment. See Using the Jupyter Notebook Interface for PGQL Property Graphs for more details.
-
Installing the Python Client in Embedded Mode
You can install and work with the Python client in embedded mode.
To install the embedded Python client:
-
Run the following command:
python3 /opt/oracle/graph/client/oracle-graph-python-embedded-26.2.0.zip --user -
Start the OPG4Py shell in embedded mode as shown:
cd /opt/oracle/graph ./bin/opg4pyNote that the shell executables are found in
/opt/oracle/graph/binafter the server installation.The OPG4Py shell starts and the following command line prompt appears as shown:
Oracle Graph Server Shell 26.2.0 >>> instance ServerInstance(embedded: True, version: 26.2.0) >>>
Uninstalling the Python Client
This section describes how to uninstall the Python client.
To uninstall the Python client, run the following command:
pip3 uninstall oracle-graph-client