question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'module' object has no attribute 'Queue'

See original GitHub issue
Traceback (most recent call last):
  File "spider_agent/conf.py", line 11, in <module>
    from kazoo.client import KazooClient
  File "/Library/Python/2.7/site-packages/kazoo/client.py", line 21, in <module>
    from kazoo.handlers.threading import SequentialThreadingHandler
  File "/Library/Python/2.7/site-packages/kazoo/handlers/threading.py", line 146, in <module>
    class SequentialThreadingHandler(object):
  File "/Library/Python/2.7/site-packages/kazoo/handlers/threading.py", line 177, in SequentialThreadingHandler
    queue_impl = Queue.Queue
AttributeError: 'module' object has no attribute 'Queue'

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
hannoschcommented, Aug 25, 2014

This sounds like you have another module named Queue somewhere in your Python path, so the wrong one gets picked up and not the one from the standard library.

You can start the interpreter, import Queue and see where it comes from, something like:

$ python2.7
>>> import Queue; Queue
<module 'Queue' from '/Library/Python/2.7/.../Queue.pyc'>

Or import sys, and expect sys.path.

Make sure to use the interpreter you also use to start the actual program with. There might be a virtualenv or other isolation bits involved.

0reactions
spmsupuncommented, Nov 5, 2019

@hannosch Oh god you are right, i file name was queue.py, i feel so stupid

Read more comments on GitHub >

github_iconTop Results From Across the Web

AttributeError 'module' has no attribute 'Queue" - Stack Overflow
Queue() AttributeError: 'module' object has no attribute 'Queue'. I am using the code in the link Threading in python using queue.
Read more >
AttributeError: module 'queue' has no attribute 'queue'? - Reddit
I can set up a virtual environment, but why?
Read more >
AttributeError: module 'queue' has no attribute 'Queue' - Steemit
When a module named spam is imported, the interpreter first searches for a built-in module with that name. If not found, it then...
Read more >
Python – AttributeError 'module' has no attribute 'Queue
Queue() AttributeError: 'module' object has no attribute 'Queue'. I am using the code in the link Threading in python using queue.
Read more >
FreeCodeCamp/python - Gitter
```from Queue import PriorityQueue ... but it failed in my code because of "AttributeError: 'Queue' object has no attribute 'queue'".
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found