Question: I'm using pyspark upon a hadoop cluster with hive. I know its possible to get the spark, hive & hadoop versions from the command-line (`spark-submit --version`, `hive --version`, `hadoop version`) but how do I do the same from within pyspark?

getting the spark version is easy enough: 

```
print("Spark version = ".format(spark._sc.version))

```

I can't figure out how to get the hive & hadoop version though. Anyone know? TIA

Answer: 
Getting them from pyspark :

```
# spark
print(f"Spark version = {spark.version}")

# hadoop
print(f"Hadoop version = {sc._jvm.org.apache.hadoop.util.VersionInfo.getVersion()}")

```
ok, I solved it by doing this:

```
from sh import hive, hadoop
print("Hive version = {0}".format(hive("--version")))
print("Hadoop version = {0}".format(hadoop("version")))

```

Would be nice if there were a way to get it from the `spark` object without having to shell out. If anyone knows a way please let me know.