python - Pyspark (spark 1.6.x) ImportError: cannot import name Py4JJavaError -


i using apache-spark (pyspark) , works fine. now, trying load data may or may not exist. so, trying catch py4jjavaerror , trying import follows:

from py4j.java_gateway import py4jjavaerror importerror: cannot import name py4jjavaerror 

when unzip file: /usr/local/cellar/apache-spark/1.6.2/python/lib/py4j-0.9-src.zip

and inspect file: java_gateway.py

i find no py4jjavaerror.

what doing wrong? other place / path should using instead?

try from py4j.protocol import py4jjavaerror.


Comments