ImportError: No module named numpy
Befor I post this issue, we have already readed all the same issue's solutions that we can find.
Our cluster is installed with cdh6.2, after install we use HUE to use the cluster. Job is submited via Hue.
When spark code need to import numpy, got error below:
Traceback (most recent call last):
File "/var/yarn/nm/usercache/admin/appcache/application_1557739482535_0001/container_1557739482535_0001_01_000001/test.py", line 79, in <module>
from pyspark.ml.linalg import Vectors
File "/var/yarn/nm/usercache/admin/appcache/application_1557739482535_0001/container_1557739482535_0001_01_000001/python/lib/pyspark.zip/pyspark/ml/__init__.py", line 22, in <module>
File "/var/yarn/nm/usercache/admin/appcache/application_1557739482535_0001/container_1557739482535_0001_01_000001/python/lib/pyspark.zip/pyspark/ml/base.py", line 24, in <module>
File "/var/yarn/nm/usercache/admin/appcache/application_1557739482535_0001/container_1557739482535_0001_01_000001/python/lib/pyspark.zip/pyspark/ml/param/__init__.py", line 26, in <module>
ImportError: No module named numpy
We followed office guied to install anaconda parcel, And setup the Spark Service Advanced Configuration Snippet (Safety Valve) for spark-conf/spark-env.sh
export PYSPARK_PYTHON=/opt/cloudera/parcels/Anaconda/bin/python
export PYSPARK_DRIVER_PYTHON=/opt/cloudera/parcels/Anaconda/bin/python
Setup the Spark Client Advanced Configuration Snippet (Safety Valve) for spark-conf/spark-defaults.conf
spark.yarn.appMasterEnv.PYSPARK_PYTHON=/opt/cloudera/parcels/Anaconda/bin/python
spark.yarn.appMasterEnv.PYSPARK_DRIVER_PYTHON=/opt/cloudera/parcels/Anaconda/bin/python
Also, setup the YARN (MR2 Included) Service Environment Advanced Configuration Snippet (Safety Valve)
PYSPARK_PYTHON=/opt/cloudera/parcels/Anaconda/bin/python
PYSPARK_DRIVER_PYTHON=/opt/cloudera/parcels/Anaconda/bin/python
But non of these can help to solve the import issue.
Thanks for any help.

