【发布时间】:2014-07-24 18:29:18
【问题描述】:
我正在尝试使用 multiprocessing.Queue 模块中的队列。 实现 (https://docs.python.org/3.4/library/multiprocessing.html#exchanging-objects-between-processes) 使用
q = Queue()
作为实例化的示例。如果我尝试这个,我会收到以下错误:
TypeError: __init__() missing 1 required keyword-only argument: 'ctx'
谷歌搜索的问题提出了这个:
http://bugs.python.org/issue21367
我怎么知道这是否已修复?现在不可能使用 multiprocessing.Queues 吗? 如果没有,我如何获得所需的 ctx 对象(它是什么?)
【问题讨论】:
-
你用的是什么版本的 Python?
-
你是如何导入
Queue的?
标签: python python-3.x multiprocessing