属性错误"模块"没有属性"队列"



我正在尝试导入队列,但不断收到以下内容

Traceback (most recent call last):
  File "threading.py", line 2, in <module>
    import Queue
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/Queue.py", line 5, in <module>
    import threading as _threading
  File "/Users/zaq/threading.py", line 10, in <module>
    queue = Queue.Queue()
AttributeError: 'module' object has no attribute 'Queue'

我正在使用链接中的代码 使用队列在python中线程

另外,我可以在python解释器中导入和使用队列。

我做错了什么?

我的脚本名称是 threading.py...改变了它,一切都很好。菜鸟错误。

最新更新