V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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 · 2019-04-16 17:47:59 +08:00 · 1317 次点击
    这是一个创建于 1827 天前的主题,其中的信息可能已经有所发展或是发生改变。

    老哥们好,嗯,我是用的是 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
       2019-04-16 18:13:55 +08:00
    OK,解决了,使用 sys 获取 python 解释器路径,然后就 OK。
    不好意思。。。。
    :)
    此贴终结。。。。
    julyclyde
        2
    julyclyde  
       2019-04-18 15:15:45 +08:00
    这不是明明是你自己的问题么,跟 Celery 有啥关系……
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2983 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 15:09 · PVG 23:09 · LAX 08:09 · JFK 11:09
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.