I set up these environment variables inside PyCharm Debug Configurations:
SPARK_HOME = /somewhere/spark-3.0.0-bin-hadoop2.7 PYTHONPATH = /somewhere/spark-3.0.