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

supervisor 的配置 env 怎么扩展 PYTHONPATH

  •  1
     
  •   simple2025 · Feb 9, 2017 · 3685 views
    This topic created in 3516 days ago, the information mentioned may be changed or developed.

    是这样 environenment=/home/xx/abc:$PYTHONPATH 还是 environment=/home/xx/abc:%(ENV_PYTHONPATH)s 呢? 我试过两种都不行啊,你们是怎么做的呀

    6 replies  •  2017-02-10 16:37:41 +08:00
    ruin2016
        1
    ruin2016  
       Feb 9, 2017
    environment=PYTHONPATH=“ xxx ”
    bonfy
        2
    bonfy  
       Feb 9, 2017
    额,我比较偷懒,直接把 virtualenv 的全路径直接放到 command 里,如:

    command=/path/virtualenv/bin/python /path/example.py

    这样也一样吧?
    simple2025
        3
    simple2025  
    OP
       Feb 10, 2017
    @bonfy 但是这样有个问题呀。。如果你有个总的 environment 怎么办?
    laibluejay
        4
    laibluejay  
       Feb 10, 2017
    @chenqh 我也和 @bonfy 一样。你说的全局的 environment 是干嘛用的
    bonfy
        5
    bonfy  
       Feb 10, 2017
    @chenqh 总的 environment 你的意思是 pip 全局安装的包咯,我觉得应该是可以继承到的? 具体你可以试下,如果不行,再在 virtualenvironment 里面再装一遍。
    simple2025
        6
    simple2025  
    OP
       Feb 10, 2017
    @laibluejay /etc/superivsor/supervisod.conf 里面也可以设置 environment ,这个 environment 可以被所有[program:]继承
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2620 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 12:22 · PVG 20:22 · LAX 05:22 · JFK 08:22
    ♥ Do have faith in what you're doing.