我不确定为什么我会得到这个 ImportError
。 queue.Queue()
在文档中。
https://docs.python.org/3/library/queue.html?highlight=queue#queue.Queue
我在这样的函数中使用它:
node_queue = queue.Queue()
错误:
Traceback (most recent call last):
File "./test_jabba.py", line 15, in <module>
from utils import gopher, jsonstream, datagen, event_gen, tree_diff, postal
File "/Users/bli1/Development/QE/TrinityTestFramework/poc/utils/tree_diff.py", line 5, in <module>
import queue
ImportError: No module named queue
第 5 行是 import queue
:
#!/usr/bin/env python3
import sys # access to basic things like sys.argv
import os # access pathname utilities
import argparse # for command-line options parsing
import queue
原文由 Liondancer 发布,翻译遵循 CC BY-SA 4.0 许可协议
有点标准的交叉 py2-py3 兼容版本: