It looks like you are not importing Queue directly from multiprocessing . When the contexts were introduced, most of the objects you imported from the top-level multiprocessing package became functions that internally receive the context and then pass this to the base class initializer, not the classes themselves. For example, here is what multiprocessing.Queue :
def Queue(self, maxsize=0): '''Returns a queue object''' from .queues import Queue return Queue(maxsize, ctx=self.get_context())
If you want to directly import multiprocessing.queues.Queue and try to instantiate it, you will get the error message that you see. But it should work fine if you import it directly from multiprocessing .
The context object tells multiprocessing which of the available methods to start subprocesses is used. multiprocessing.Queue uses multiprocessing.Lock internally, which must correctly know the correct context.
source share