Installing Python for PyFlink

Before you can use Flink with the Python API, you need to install Python on your clusters if Python is not already installed on the Flink Gateway node and the YARN NameNode.

  1. Connect to the Flink Gateway node using CLI.
    ssh root@<FLINK_GATEWAY_NODE>
  2. Check the version of Python.
    python --version
    If the command fails or the versions are lower than 3.6, install Python.
  3. Install Python using the following command:
    python -m pip install apache-flink==1.16.1
  4. Install Python on the YARN NameNode as well using the same steps.
When the Python installation is complete, you can submit Flink application that were created using the Python API.