推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
x14oL
V2EX  ›  Python

Celery 动态加载模块的问题

  •  
  •   x14oL · May 21, 2015 · 3872 views
    This topic created in 4034 days ago, the information mentioned may be changed or developed.
    在用芹菜过程中,需要根据传入的参数动态的载入模块。
    使用了
    import_string = "from exp.%s import exeCla" % lab[exp_id]
    exec import_string

    使用命令:
    celery -A celerytasks worker --loglevel=info --pool=solo
    开启
    在开启队列的情况下就会爆
    ImportError: No module named exp.helloworld
    的错误。

    直接调用对应代码是没有问题的。

    是不是我开启的命令有什么问题?
    求指教!
    1 replies    2015-05-21 16:57:56 +08:00
    bigdude
        1
    bigdude  
       May 21, 2015
    CELERYD_CHDIR
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2897 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 06:16 · PVG 14:16 · LAX 23:16 · JFK 02:16
    ♥ Do have faith in what you're doing.