Skip to content

AttributeError: module 'rq.cli.cli' has no attribute 'worker' #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ggranger opened this issue May 18, 2025 · 2 comments · Fixed by #54
Closed

AttributeError: module 'rq.cli.cli' has no attribute 'worker' #51

ggranger opened this issue May 18, 2025 · 2 comments · Fixed by #54
Milestone

Comments

@ggranger
Copy link

ggranger commented May 18, 2025

Hello, first thanks a lot to the Pallets team for reviving this extension!

I'm trying to add it to my project but I can't get past this error:

web-1           |   File "/home/myapp/wsgi.py", line 3, in <module>
web-1           |     from app import create_application
web-1           |   File "/home/myapp/app/__init__.py", line 14, in <module>
web-1           |     from flask_rq import RQ
web-1           |   File "/home/myapp/venv/lib/python3.12/site-packages/flask_rq/__init__.py", line 5, in <module>
web-1           |     from ._extension import RQ
web-1           |   File "/home/myapp/venv/lib/python3.12/site-packages/flask_rq/_extension.py", line 12, in <module>
web-1           |     from ._cli import make_cli
web-1           |   File "/home/myapp/venv/lib/python3.12/site-packages/flask_rq/_cli.py", line 68, in <module>
web-1           |     orig_cli.worker,
web-1           |     ^^^^^^^^^^^^^^^
web-1           | AttributeError: module 'rq.cli.cli' has no attribute 'worker'

It looks like the 'worker' was indeed recently moved out of rq.cli.cli with this commit in the rq project 3 weeks ago, might it be related ?

Edit: I confirm rq v2.3.3 broke compatibility, pinning rq version to 2.3.2 fixes this issue.

Environment:

  • Python version: 3.12.5
  • Flask version: 3.1.1
  • Flask-RQ version: 0.3.2
  • rq version: 2.3.3
@strr
Copy link

strr commented May 19, 2025

Just hit this myself. I can confirm that pinning to RQ 2.3.2 makes:
from flask_rq import RQ
succeed.

@agordon
Copy link

agordon commented May 25, 2025

+1 - this PR fixes the same issue for me.

May I kindly ask/encourage Flask-RQ developers to publish a new version on PyPI with this PR ?
Currently a simple pip install --upgrade flask rq flask-rq will break existing applications (both the RQ worker and the Flask App entirely), while it has been working flawlessly for many years, up until these recent months.

BTW - many thanks for developing Flask-RQ, I've been using it for many years, and your work is very much appreciated. I'm happy to see a renewed interest in version 0.3.X .

@davidism davidism added this to the 1.0.0 milestone May 31, 2025
@davidism davidism closed this as completed Jun 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

4 participants