我有以下主管配置主管不更新PYTHONPATH可變
[program:do_thing]
command = python -u stuff/do_thing.py
directory = /home/ubuntu/code/processing
environment = PYTHONPATH="$PYTHONPATH:/home/ubuntu/code/utils/"
stdout_logfile = /mnt/log/do_thing.log
redirect_stderr = true
問題是/home/ubuntu/code/utils/
根據sys.path中不被包含我的PYTHONPATH(我不能從那裏導入模塊)。 Sys.path顯示所有正確的路徑,除了這個額外的路徑。我已經嘗試將它添加到自己和root用戶的.bashrc中,但他們沒有被主管接收。
我在做什麼錯誤的主管不能正確更新環境變量?你需要更多信息嗎?謝謝!
東西,我注意到還有:在Ubuntu用戶,sys.path中是 ['', '/home/ubuntu/code/processing', '/home/ubuntu/code/utils', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/pymodules/python2.7']
當內部主管叫,它是: ['/home/ubuntu/code/processing/stuff', '/', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/pymodules/python2.7']
請注意,在主管sys.path中有一個'/'條目?那個是從哪裏來的?
我無法管理使用'evironment'更新路線上,但我在這個問題的解決方案遇到:HTTP:// stackoverflow.com/questions/7191613/how-can-i-set-the-path-for-supervisord-so-it-finds-the-executables HTH – 2013-12-19 12:44:32