推荐学习书目
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
RedFlag2233
V2EX  ›  Python

Celery 的问题

  •  
  •   RedFlag2233 · Apr 16, 2019 · 2248 views
    This topic created in 2596 days ago, the information mentioned may be changed or developed.

    老哥们好,嗯,我是用的是 Pychram 在 win 下开发,然后在 Ubuntu 里运行项目。 现在有个问题,我 Pychram 设置的 Project Interpreter 是 Ubuntu 里的一个虚拟环境,Celery 是安装在这个虚拟环境中的,现在我有一段如下代码:

    import subprocess
    cmdline = "celery -A scanner worker -l info"
    child = subprocess.Popen(cmdline, shell=True)
    

    之后就直接去找系统环境中的 Celery,但是系统环境没有 Celery 所以报错了。 我不明白,为什么不去使用虚拟环境中的 Celery。

    小白一个,希望有大哥帮帮我。

    RedFlag2233
        1
    RedFlag2233  
    OP
       Apr 16, 2019
    OK,解决了,使用 sys 获取 python 解释器路径,然后就 OK。
    不好意思。。。。
    :)
    此贴终结。。。。
    julyclyde
        2
    julyclyde  
       Apr 18, 2019
    这不是明明是你自己的问题么,跟 Celery 有啥关系……
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3516 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 11:16 · PVG 19:16 · LAX 04:16 · JFK 07:16
    ♥ Do have faith in what you're doing.