我可以在python shell中正确运行以下代码,但无法在zeppelin python解释器中运行它。这是zeppelin的python解释器的实现。 https://github.com/zjffdu/zeppelin/blob/master/spark/src/main/resources/python/zeppelin_pyspark.py
有没有人可以帮助我理解为什么泡菜在zeppelin python解释器中不起作用?感谢
代码
def f():
"hello"
import pickle
pickle.dumps(f)
输出
Fail to execute line 5: pickle.dumps(f)
Traceback (most recent call last):
File "/var/folders/dp/hmchg5dd3vbcvds26q91spdw0000gp/T/zeppelin_pyspark-5559547270503920588.py", line 338, in <module>
exec(code, _zcUserQueryNameSpace)
File "<stdin>", line 5, in <module>
_pickle.PicklingError: Can't pickle <function f at 0x104317840>: attribute lookup f on __main__ failed