I wanted to continue Indrajeet's answer, as he mentioned line numbers instead of the exact location of the code. See This is in addition to his answer for further clarification.
cls = _old_namedtuple (* args, ** kwargs)
this is the line that was changed in the answer
def _hijack_namedtuple(): """ Hack namedtuple() to make it picklable """ # hijack only one time if hasattr(collections.namedtuple, "__hijack"): return global _old_namedtuple # or it will put in closure def _copy_func(f): return types.FunctionType(f.__code__, f.__globals__, f.__name__, f.__defaults__, f.__closure__) _old_namedtuple = _copy_func(collections.namedtuple) def namedtuple(*args, **kwargs): # cls = _old_namedtuple(*args, **kwargs) cls = _old_namedtuple(*args, **kwargs, verbose=False, rename=False, module=None) return _hack_namedtuple(cls)
!!! EDIT March 6, 2017! This does fix the original problem, but I donβt think it will make spark 2.1 compatible with 3.6, but even more collisions. As a result, I used conda to create a python 35 virtual environment and worked like a charm.
(Windows if you have env variables)
>conda create -n py35 python=3.5 >activate py35 >pyspark
DS
source share