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.

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:

You can install and verify the Python client installation as shown:

  1. Install the client through pip.

    For example,

    pip install --user oracle-graph-client

    This installs the Python client along with all the required dependencies.

  2. 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 pypgx

    See Also:

Upgrading the Python Client

This section describes how to upgrade the Python client.

  1. 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
  2. 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:

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.

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:

  1. Download the Oracle Graph Client from Oracle Software Cloud.

    For example, oracle-graph-client-26.2.0.zip.

  2. Unzip the file into a directory of your choice.

    The unzipped folder contains the oracle-graph-python-client-26.2.0.zip file for installing the Python client.

  3. Install the Python client by running the following command.

python3 oracle-graph-python-client-26.2.0.zip --user
  1. Configure your client to trust the self-signed keystore. See Configuring a Client to Trust the Self-Signed Keystore for more information.

  2. 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>:7007

    In the preceding code:

    • <CLIENT_INSTALL_DIR>: Directory where the shell executables are located.

      The shell executables are found in <CLIENT_INSTALL_DIR>/bin after the client installation.

    • <host>: Server host

    Note: The graph server (PGX), listens on port 7007 by 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:

  1. Run the following command:

    python3 /opt/oracle/graph/client/oracle-graph-python-embedded-26.2.0.zip --user
  2. Start the OPG4Py shell in embedded mode as shown:

    cd /opt/oracle/graph
    ./bin/opg4py

    Note that the shell executables are found in /opt/oracle/graph/bin after 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