Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AttributeError 'module' has no attribute 'Queue"

Tags:

python

I am trying to import Queue and I keep getting the following

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'

I am using the code in the link Threading in python using queue

Also, I can import and use Queue in the python interpreter.

What am I doing wrong?

like image 267
Clocker Avatar asked Dec 09 '22 10:12

Clocker


1 Answers

Name of my script was threading.py... Changed it and everthing works fine. Rookie mistake.

like image 131
Clocker Avatar answered Dec 27 '22 14:12

Clocker