0

我正在使用 linux (fedora) 机器,我想在 python3.3 中使用 celery。当我执行这些命令时:

celery -A tasks worker --loglevel=info
celery worker --help

我收到以下错误:

    [root@localhost gert]# celery -A tasks worker --loglevel=info
Traceback (most recent call last):
  File "/usr/lib/python3.3/site-packages/celery-3.1.0rc1-py3.3.egg/celery/bin/base.py", line 399, in find_app
    sym = self.symbol_by_name(app)
  File "/usr/lib/python3.3/site-packages/celery-3.1.0rc1-py3.3.egg/celery/bin/base.py", line 418, in symbol_by_name
    return symbol_by_name(name, imp=import_from_cwd)
  File "/usr/lib/python3.3/site-packages/kombu-2.5.9-py3.3.egg/kombu/utils/__init__.py", line 80, in symbol_by_name
    module = imp(module_name, package=package, **kwargs)
  File "/usr/lib/python3.3/site-packages/celery-3.1.0rc1-py3.3.egg/celery/utils/imports.py", line 87, in import_from_cwd
    return imp(module, package=package)
  File "/usr/lib64/python3.3/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1577, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1558, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1525, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 586, in _check_name_wrapper
  File "<frozen importlib._bootstrap>", line 1023, in load_module
  File "<frozen importlib._bootstrap>", line 1004, in load_module
  File "<frozen importlib._bootstrap>", line 562, in module_for_loader_wrapper
  File "<frozen importlib._bootstrap>", line 869, in _load_module
  File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
  File "/home/gert/tasks.py", line 3, in <module>
    celery = Celery('tasks', broker='amqp://guest@localhost//')
  File "/usr/lib/python3.3/site-packages/celery-3.1.0rc1-py3.3.egg/celery/app/base.py", line 131, in __init__
    if self._config_source:
AttributeError: 'Celery' object has no attribute '_config_source'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/celery", line 9, in <module>
    load_entry_point('celery==3.1.0rc1', 'console_scripts', 'celery')()
  File "/usr/lib/python3.3/site-packages/celery-3.1.0rc1-py3.3.egg/celery/__main__.py", line 30, in main
    main()
  File "/usr/lib/python3.3/site-packages/celery-3.1.0rc1-py3.3.egg/celery/bin/celery.py", line 77, in main
    cmd.execute_from_commandline(argv)
  File "/usr/lib/python3.3/site-packages/celery-3.1.0rc1-py3.3.egg/celery/bin/celery.py", line 709, in execute_from_commandline
    super(CeleryCommand, self).execute_from_commandline(argv)))
  File "/usr/lib/python3.3/site-packages/celery-3.1.0rc1-py3.3.egg/celery/bin/base.py", line 260, in execute_from_commandline
    argv = self.setup_app_from_commandline(argv)
  File "/usr/lib/python3.3/site-packages/celery-3.1.0rc1-py3.3.egg/celery/bin/base.py", line 388, in setup_app_from_commandline
    self.app = self.find_app(app)
  File "/usr/lib/python3.3/site-packages/celery-3.1.0rc1-py3.3.egg/celery/bin/base.py", line 402, in find_app
    sym = import_from_cwd(app)
  File "/usr/lib/python3.3/site-packages/celery-3.1.0rc1-py3.3.egg/celery/utils/imports.py", line 87, in import_from_cwd
    return imp(module, package=package)
  File "/usr/lib64/python3.3/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1577, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1558, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1525, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 586, in _check_name_wrapper
  File "<frozen importlib._bootstrap>", line 1023, in load_module
  File "<frozen importlib._bootstrap>", line 1004, in load_module
  File "<frozen importlib._bootstrap>", line 562, in module_for_loader_wrapper
  File "<frozen importlib._bootstrap>", line 869, in _load_module
  File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
  File "/home/gert/tasks.py", line 3, in <module>
    celery = Celery('tasks', broker='amqp://guest@localhost//')
  File "/usr/lib/python3.3/site-packages/celery-3.1.0rc1-py3.3.egg/celery/app/base.py", line 131, in __init__
    if self._config_source:
AttributeError: 'Celery' object has no attribute '_config_source'

我已经安装了所需的包,所以我在 python3.3 中的站点包映射如下所示:

  • celery-3.1.0rc1-py3.3.egg
  • amqp-1.2.0-py3.3
  • anyjson-0.3.3-py3.3.egg
  • 台球-3.3.0.0rc1-py3.3.egg
  • 分发-0.6.28-py3.3.egg-info
  • 易安装.py
  • kombu-2.5.9-py3.3.egg
  • pip-1.2.1-py3.3.egg-info
  • pkg_resources.py
  • pycache(带下划线)
  • python_dateutil-2.0-py3.3.egg
  • pytz-2013b-py3.3.egg
  • 安装工具
  • setuptools-0.6c11-py3.3.egg-info
  • 网站.py
  • 6-1.3.0-py3.3.egg

有谁知道我错过了什么,或者我做错了什么?

4

1 回答 1

1

正如martijn所说,答案很简单。有人在 github 上对 celery 项目进行了提交,我提取了我以前的版本,现在它可以工作了。当他们修复它时,这个错误应该不是什么大问题。

于 2013-04-11T17:29:34.663 回答