Pyflink get_gateway() method is not working

  pycharm, pyflink, python

I am using pycharm to run simple pyflink latest 1.13 example (it is only two line).
for the interpreter i created virtual environment and use it in my pycharm project
I downloaded also java8
i tried many steps to solve the issue but

from pyflink.common.serialization import Encoder
from pyflink.common.typeinfo import Types
from pyflink.datastream import StreamExecutionEnvironment
from pyflink.datastream.connectors import StreamingFileSink
def print_hi(name):
    # Use a breakpoint in the code line below to debug your script.
    print(f'Hi, {name}')  # Press Ctrl+F8 to toggle the breakpoint.
    env = StreamExecutionEnvironment.get_execution_environment()

C:UsersmyuserAppDataLocalProgramsPythonPython38myvenvScriptspython.exe C:/Users/myuser/PycharmProjects/pythonProject3/
Hi, PyCharm
Traceback (most recent call last):
File "C:/Users/myuser/PycharmProjects/pythonProject3/", line 19, in
File "C:/Users/myuser/PycharmProjects/pythonProject3/", line 13, in print_hi
env = StreamExecutionEnvironment.get_execution_environment()
File "", line 688, in get_execution_environment
gateway = get_gateway()
File "", line 62, in get_gateway
_gateway = launch_gateway()
File "", line 106, in launch_gateway
p = launch_gateway_server_process(env, args)
File "", line 221, in launch_gateway_server_process
return Popen(command, stdin=PIPE, preexec_fn=preexec_fn, env=env)
File "", line 858, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "", line 1311, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

i hope any one can help

Source: Python Questions

One Reply to “Pyflink get_gateway() method is not working”