x1export SPARK_HOME=/opt/spark2export PATH=$SPARK_HOME/bin:$PATH34export PYSPARK_DRIVER_PYTHON=jupyter5# You may have to increase the default iopub_data_rate_limit which is 10000006export PYSPARK_DRIVER_PYTHON_OPTS='notebook --NotebookApp.iopub_data_rate_limit=\7100000000.0'xxxxxxxxxx1# cp from /opt/spark/conf/spark-env.sh.template to create spark-env.sh if non-existant2# add the following line3export JAVA_HOME=/path_to_jdk/jdk8u232-b09/Contents/Homexxxxxxxxxx1# Set Path JDK1.8 2# cp from /opt/spark/conf/spark-defaults.conf.template to create spark-defaults.conf3# add the following line4# uncomment the spark.driver.memory and change it according to your use. 5spark.driver.memory 5g6spark.executorEnv.JAVA_HOME=/path_to_jdk/jdk8u232-b09/Contents/Homexxxxxxxxxx21# run2/opt/spark/bin/pysparkIn Project Structure click Add Content Root to add
/opt/spark-2.4.4/python/lib/py4j-0.10.7-src.zip and
/opt/spark-2.4.4/python/lib/pyspark.zip