minrk / findspark

BSD 3-Clause "New" or "Revised" License
511 stars 72 forks source link

Added descriptive error when py4j can't be found #27

Closed ShaynAli closed 5 years ago

ShaynAli commented 5 years ago

Ran into this issue while attempting to use the library and got a "IndexError", this change makes it much more clear that something is probably wrong with the user's config of Spark, since py4j cannot be found (at least, this is what happened in my case, open to a more general rephrasing).

ShaynAli commented 5 years ago

An alternative is os.path.isdir(spark_home), but this is more in the spirit of EAFP

minrk commented 5 years ago

Thanks!