简体   繁体   中英

python rq Queue import error

I'm using python v2.7.3 - Installed python-rq via easy_install. While trying to create RQ queue with steps given at http://python-rq.org/ . it fails with message like

>>> from redis import Redis
>>> from rq import Queue
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "rq.py", line 11, in <module>
    q = Queue(connection=Redis())
TypeError: 'module' object is not callable
>>> 
>>> q = Queue(connection=Redis())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'Queue' is not defined
>>> 

Whats the issue here and how to fix this?

Reposting comment as answer:

Thanks for the answer. Sorry stupid me! .sometime back I created file named rq.py and its creating problem. Deleted that file.solved the issue

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM