BryanCutler commented on a change in pull request #28152: [SPARK-31382][BUILD]
Show a better error message for different python and pip installation mistake
URL: https://github.com/apache/spark/pull/28152#discussion_r405878925
##########
File path: python/pyspark/find_spark_home.py
##########
@@ -68,6 +69,18 @@ def is_spark_home(path):
return next(path for path in paths if is_spark_home(path))
except StopIteration:
print("Could not find valid SPARK_HOME while searching
{0}".format(paths), file=sys.stderr)
+ if import_error_raised:
+ print(
+ "\nDid you install PySpark via a package manager such as PIP
or Conda? If so,\n"
+ "PySpark was not found in your Python executable. It is
possible your\n"
+ "Python executable does not properly bind with your package
manager.\n"
+ "\nPlease check your default 'python' and if you set
PYSPARK_PYTHON and/or\n"
+ "PYSPARK_DRIVER_PYTHON environment variables, and see if you
can import PySpark.\n"
Review comment:
maybe explicitly say try the command `python -c 'import pyspark'`?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]