cannot find python3.7 when runing spark using spark-submit?

馋奶兔 提交于 2019-12-11 17:16:09

问题


There is a problem that has bothered me for a few days. It occurs when I am running Spark application using spark-submit, it shows like this below:

09:14:36 Exception in thread "main" java.io.IOException: Cannot run program "python3.7": error=2, No such file or directory
09:14:36    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
09:14:36    at org.apache.spark.deploy.PythonRunner$.main(PythonRunner.scala:100)
09:14:36    at org.apache.spark.deploy.PythonRunner.main(PythonRunner.scala)
09:14:36    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
09:14:36    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
09:14:36    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
09:14:36    at java.lang.reflect.Method.invoke(Method.java:498)
09:14:36    at org.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)
09:14:36    at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:894)
09:14:36    at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:198)
09:14:36    at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:228)
09:14:36    at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:137)
09:14:36    at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
09:14:36 Caused by: java.io.IOException: error=2, No such file or directory
09:14:36    at java.lang.UNIXProcess.forkAndExec(Native Method)
09:14:36    at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
09:14:36    at java.lang.ProcessImpl.start(ProcessImpl.java:134)
09:14:36    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
09:14:36    ... 12 more

I have configured all the environment Variables both in ~/.bashrc and /etc/profile. And I am absolutely sure that all the environment variables are correct. And I can run python3.7 or PySpark in my Ubuntu.

export JAVA_HOME=/usr/lib/jvm/java-8-oracle
export PATH=${PATH}:${JAVA_HOME}
export PATH=${PATH}:/mwdata/python3.7/bin
export SPARK_HOME=/srv/spark
export PATH=${PATH}:${SPARK_HOME}/bin
export PYSPARK_PYTHON=python3.7
export PYSPARK_DRIVER_PYTHON=python3.7

So why doesn't it find python3.7?


回答1:


At its core PySpark depends on Py4J (currently version 0.10.7)

Unfortunately current version of py4j 0.10.7 is not compatible with Python 3.7.



来源:https://stackoverflow.com/questions/52031784/cannot-find-python3-7-when-runing-spark-using-spark-submit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!