I would need to know whether you have tried following configuration of --packages
:
spark-submit \
--packages org.mongodb.spark:mongo-spark-connector_2.12:x.y.z \
your_spark_script.py
This would help me in knowing Spark configuration better.