Reliably and quickly detect, from Python, whether Spark is installed

Viewed 26

My team is maintaining a library built on top of PySpark; it requires a working Spark installation to function (which means the user must have Java installed, JAVA_HOME correctly set, etc.).

We'd like to be able to automatically detect, whenever our library is either installed (via pip) or imported, whether this dependency was correctly installed, so we print a helpful error message if it wasn't.

Is there a standard way of doing this?

0 Answers
Related