对
os.environ
赋值
ssh://[email protected]:22/usr/bin/python -u /home/data/tmp_test/trunk/personas/tmp_spark_mongo_relset_javahome.py JAVA_HOME is not set Traceback (most recent call last): File "/home/data/tmp_test/trunk/personas/tmp_spark_mongo_relset_javahome.py", line 16, in <module> .appName("PythonPi")\ File "/root/.local/lib/python3.6/site-packages/pyspark/sql/session.py", line 169, in getOrCreate sc = SparkContext.getOrCreate(sparkConf) File "/root/.local/lib/python3.6/site-packages/pyspark/context.py", line 334, in getOrCreate SparkContext(conf=conf or SparkConf()) File "/root/.local/lib/python3.6/site-packages/pyspark/context.py", line 115, in __init__ SparkContext._ensure_initialized(self, gateway=gateway, conf=conf) File "/root/.local/lib/python3.6/site-packages/pyspark/context.py", line 283, in _ensure_initialized SparkContext._gateway = gateway or launch_gateway(conf) File "/root/.local/lib/python3.6/site-packages/pyspark/java_gateway.py", line 95, in launch_gateway raise Exception("Java gateway process exited before sending the driver its port number") Exception: Java gateway process exited before sending the driver its port number ssh://[email protected]