我无法腌制以下课程。我正在使用数据块 6.5 ML(包括 Apache Spark 2.4.5、Scala 2.11)
import pickle
class Person:
def __init__(self, name, age):
self.name = name
self.age = age
p1 = Person("John", 36)
pickle.dump(p1,open('d.pkl','wb'))```
PicklingError: Can't pickle <class '__main__.Person'>: attribute lookup Person on __main__ failed