Closed mint-octopi closed 3 years ago
这是我使用 python xxx.py 命令时出现的错误
如果使用 flink run -py xxx.py 会出现另外一种错误
exec(code, run_globals)
File "/var/folders/34/q1ktbtsx5hz4bxm3k7kkmjc80000gn/T/pyflink/9f4c26fe-1ec1-402f-8b00-1ac40b12f058/05ace10a-5476-40b6-a262-b0b4151a6cb1/batch.py", line 51, in <module>
t_env.execute_sql(f"""
AttributeError: 'BatchTableEnvironment' object has no attribute 'execute_sql'
org.apache.flink.client.program.OptimizerPlanEnvironment$ProgramAbortException
at org.apache.flink.client.python.PythonDriver.main(PythonDriver.java:96)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:321)
at org.apache.flink.client.program.PackagedProgram.invokeInteractiveModeForExecution(PackagedProgram.java:205)
at org.apache.flink.client.ClientUtils.executeProgram(ClientUtils.java:139)
at org.apache.flink.client.cli.CliFrontend.executeProgram(CliFrontend.java:670)
at org.apache.flink.client.cli.CliFrontend.run(CliFrontend.java:213)
at org.apache.flink.client.cli.CliFrontend.parseParameters(CliFrontend.java:901)
at org.apache.flink.client.cli.CliFrontend.lambda$main$10(CliFrontend.java:974)
at org.apache.flink.runtime.security.NoOpSecurityContext.runSecured(NoOpSecurityContext.java:30)
at org.apache.flink.client.cli.CliFrontend.main(CliFrontend.java:974)
会莫名其妙的显示
'BatchTableEnvironment' object has no attribute 'execute_sql'
但是点进BatchTableEnvironment是有这个方法的呀 不知道这两个情况是不是相关的, 看起来可能都是环境方面的问题
问题已解决
same error,SOS !!
您好, 请问在运行代码的时候 启动环境会报错
具体在 运行 EnvironmentSettings.new_instance() 就已经报错了
错误位置在 java_gateway.py 这个文件中
感觉是环境问题 但是没找到相关资料 耽误大神几分钟时间解答一下, 感激