Relative Content

Tag Archive for pythonpickle

How does pickle find modules when loading from a file?

I’m trying to understand how pickling works so that I can correctly design the organization of my repository. Essentially, I pickle objects of type A, whose instances contain objects of type B. A and B are defined in modules in separate packages:

How does pickle find modules when loading from a file?

I’m trying to understand how pickling works so that I can correctly design the organization of my repository. Essentially, I pickle objects of type A, whose instances contain objects of type B. A and B are defined in modules in separate packages:

How does pickle find modules when loading from a file?

I’m trying to understand how pickling works so that I can correctly design the organization of my repository. Essentially, I pickle objects of type A, whose instances contain objects of type B. A and B are defined in modules in separate packages:

Python can’t pickle custom types

I am trying to run a function in a ProcessPool, the function will load some custom class by read a python file and run a method from generated class.
The error I encountered is
TypeError: cannot pickle 'generator' object
The method needs to return a generator. How could I fix this problem, Thank you.

Loading python classes using pickle gives error: init missing arguments

I have a class which contains some basic information as well as other classes, when saving this class
the attribute buildings gives error upon loading
TypeError: Building.__init__() missing 2 required positional arguments: 'name' and 'jobs'
without the saving and loading function it works perfectly fine.