1.3.5.2 Installing the Python Client

To install the Python client, you must ensure that your system meets the prerequisites mentioned in Prerequisites for Installing the Python Client.

You can execute 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-22.2.0.zip.
  2. Install the client through pip.
    For example,
    pip3 install --user oracle-graph-client-22.2.0.zip
  3. Configure your client to trust the self-signed server certificate. See Configuring a Client to Trust the Self-Signed Certificate for more information.
  4. 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 generally found in /opt/oracle/graph/bin after server installation, and <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 22.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 Also:

    Python API Reference for more information on the Python APIs