Skip to content
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

Fresh installation of 2.0.1 seems broken #1320

Closed
nathan-mill opened this issue Aug 30, 2023 · 5 comments
Closed

Fresh installation of 2.0.1 seems broken #1320

nathan-mill opened this issue Aug 30, 2023 · 5 comments
Labels

Comments

@nathan-mill
Copy link

nathan-mill commented Aug 30, 2023

Added Flower to a Django app via poetry add flower. venv is properly activated. Everything else in the project works exactly as expected.

Flower Package is present and accounted for:

% ls .venv/lib/python3.11/site-packages/flower                                                                                                                                                                    
total 40
-rw-r--r--   1 nate  staff   204B Aug 29 19:08 __main__.py
drwxr-xr-x   4 nate  staff   128B Aug 29 19:15 __pycache__/
-rw-r--r--   1 nate  staff   3.4K Aug 29 19:08 app.py
-rw-r--r--   1 nate  staff   5.7K Aug 29 19:08 command.py
-rw-r--r--   1 nate  staff   1.6K Aug 29 19:08 inspector.py
drwxr-xr-x   6 nate  staff   192B Aug 29 19:15 static/
drwxr-xr-x  11 nate  staff   352B Aug 29 19:15 templates/

That very same site-packages directory IS included in the sys.path of the very same interpreter binary that is executing everything else in the venv.

Output from the attempt at printing a bug report:

% python -c 'from flower.utils import bugreport; print(bugreport())'                                                                                                                                              
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'flower.utils'

Immediate crash when I try to run Flower:

% celery -A myapp flower                                                                                                                                                                                          

Warning: entry point could not be loaded. Contact its author for help.


Traceback (most recent call last):
  File "/Users/nate/dev/myapp/.venv/lib/python3.11/site-packages/click_plugins/core.py", line 37, in decorator
    group.add_command(entry_point.load())
                      ^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.5/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/metadata/__init__.py", line 202, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.5/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/Users/nate/dev/myapp/.venv/lib/python3.11/site-packages/flower/command.py", line 17, in <module>
    from .app import Flower
  File "/Users/nate/dev/myapp/.venv/lib/python3.11/site-packages/flower/app.py", line 13, in <module>
    from .urls import handlers as default_handlers
ModuleNotFoundError: No module named 'flower.urls'

I've wiped out the venv and all pycache folders and .pyc files repeatedly. I always wind up in this state again after poetry install. Wiped out the entire repository and cloned it over from scratch. Somehow, Flower gets installed in the same place as every other working dependency, yet is not actually usable in any way.

Downgrading from 2.0.1 to 2.0.0 seems to make it work.

@mher
Copy link
Owner

mher commented Sep 4, 2023

I'm not able to reproduce this. Version 2.0.1 works in a new virtual environment

@mher mher closed this as completed Sep 4, 2023
@nathan-mill
Copy link
Author

The problem persists here. Are you installing via Poetry in your testing?

@mher
Copy link
Owner

mher commented Sep 7, 2023

I tried with pipenv

@krupakar1329
Copy link

getting error Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/tornado/http1connection.py", line 276, in _read_message delegate.finish() File "/usr/local/lib/python3.11/site-packages/tornado/routing.py", line 268, in finish self.delegate.finish() File "/usr/local/lib/python3.11/site-packages/tornado/web.py", line 2395, in finish self.execute() File "/usr/local/lib/python3.11/site-packages/tornado/web.py", line 2417, in execute self.handler = self.handler_class( ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/flower/views/auth.py", line 86, in __new__ return instantiate(options.auth_provider or NotFoundErrorHandler, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/celery/utils/imports.py", line 48, in instantiate return symbol_by_name(name)(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/kombu/utils/imports.py", line 59, in symbol_by_name module = imp(module_name, package=package, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<frozen importlib._bootstrap>", line 1204, in _gcd_import File "<frozen importlib._bootstrap>", line 1176, in _find_and_load File "<frozen importlib._bootstrap>", line 1126, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "<frozen importlib._bootstrap>", line 1204, in _gcd_import File "<frozen importlib._bootstrap>", line 1176, in _find_and_load File "<frozen importlib._bootstrap>", line 1126, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "<frozen importlib._bootstrap>", line 1204, in _gcd_import File "<frozen importlib._bootstrap>", line 1176, in _find_and_load File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked ModuleNotFoundError: No module named '"flower'
in kubernetes environment setup with Github as oauth.
spec: containers: - args: - flower - --url_prefix=core/monitor - --auth_provider="flower.views.auth.GithubLoginHandler" - --auth=".*@domain.com" command: - celery env: - name: FLOWER_OAUTH2_KEY value: xxx - name: FLOWER_OAUTH2_SECRET value: xxx - name: FLOWER_OAUTH2_REDIRECT_URI value: xxx

@ericmeadows
Copy link

I have the same issue, @krupakar1329 - did you solve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants