Configure .bashrc with findspark
mainTo ensure environment variables are set whenever a new shell is opened, you can use findspark.init() with edit_rc=True. This will attempt to add the necessary configurations to your .bashrc file if it exists.
import findspark
findspark.init('/path/to/spark_home', edit_rc=True)