pyflink winerror 2 get_gateway()



按照链接描述的stackOverflow链接上的脚本,只更改了数据,我想评估pyflink的简单用法,以分析它的安装是否有效。您可以看到下面的系统,为了安装它,我使用pip-m将apache-flink安装到带有python3.8.4的虚拟环境中。为了安装flink本身,我使用了docker,并导入了pyflink/playgrounds:1.10.0的图像。下面是我修改的链接中唯一的部分

source_ddl = """
CREATE TABLE MyUserTable (
column_a INT,
column_b INT,

) WITH (
'connector' = 'filesystem',         
'path' = 'file:///Users//code/examples/input.csv ', 
'format' = 'csv'
)"""

#connector for data output/sink
sink_ddl = """
CREATE TABLE results (
score INT)
WITH (
'connector' = 'filesystem',
'path' = 'file:///Users//code/examples/output.csv',
'format' = 'csv'
)"""
#make the table corresponding to the schema mentioned
source_table = table_env.execute_sql(source_ddl)
sink_table = table_env.execute_sql(sink_ddl)
#convert the sql table to table API
table_path = table_env.from_path("MyUserTable")
# execute SELECT statement
table_result2 = table_env.execute_sql("SELECT column_a FROM MyUserTable")
table_result2.print()

错误如下:

Traceback (most recent call last):
File ".flink1.py", line 15, in <module>
env_settings = EnvironmentSettings.new_instance().in_batch_mode().use_blink_planner().build()
File "C:UserslandrAppDataLocalProgramsPythonPython38libsite-packagespyflinktableenvironment_settings.py", line 214, in new_instance
return EnvironmentSettings.Builder()
File "C:UserslandrAppDataLocalProgramsPythonPython38libsite-packagespyflinktableenvironment_settings.py", line 48, in __init__
gateway = get_gateway()
File "C:UserslandrAppDataLocalProgramsPythonPython38libsite-packagespyflinkjava_gateway.py", line 62, in get_gateway
_gateway = launch_gateway()
File "C:UserslandrAppDataLocalProgramsPythonPython38libsite-packagespyflinkjava_gateway.py", line 106, in launch_gateway
p = launch_gateway_server_process(env, args)
File "C:UserslandrAppDataLocalProgramsPythonPython38libsite-packagespyflinkpyflink_gateway_server.py", line 221, in launch_gateway_server_process
return Popen(command, stdin=PIPE, preexec_fn=preexec_fn, env=env)
File "C:UserslandrAppDataLocalProgramsPythonPython38libsubprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:UserslandrAppDataLocalProgramsPythonPython38libsubprocess.py", line 1307, in _execute_child   
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] Impossibile trovare il file specificato

我今天遇到了这个错误。我在pyflink_gateway_server.py中放入了一个print语句,以显示正在传递的命令。我发现调用的Java版本在我的电脑上已经不存在了(我已经升级了它(。

修复是为了确保JAVA_HOME指向有效的JAVA安装。

相关内容

  • 没有找到相关文章

最新更新