Python 监管者可以';在virtualenv文件夹中找不到命令

Python 监管者可以';在virtualenv文件夹中找不到命令,python,virtualenv,supervisord,Python,Virtualenv,Supervisord,我的supervisord.conf包含一系列程序,如下所示: [program:gtaskqueue_puller_1] directory=/root/scripts/gtaskqueue_puller command=venv/bin/gtaskqueue_puller "foo" autostart=true autorestart=true [program:gtaskqueue_puller_2] directory=/root/scripts/gtaskqueue_puller

我的
supervisord.conf
包含一系列程序,如下所示:

[program:gtaskqueue_puller_1]
directory=/root/scripts/gtaskqueue_puller
command=venv/bin/gtaskqueue_puller "foo"
autostart=true
autorestart=true

[program:gtaskqueue_puller_2]
directory=/root/scripts/gtaskqueue_puller
command=venv/bin/gtaskqueue_puller "bar"
autostart=true
autorestart=true
但有时当我重新启动supervisord时

can't find command venv/bin/gtaskqueue_puller

但是,当我
cd
进入目录并运行相同的命令时,它会按预期工作

有时,即使设置了目录,主管也无法找到具有相对路径的命令

因此,请使用:

[program:gtaskqueue_puller_1]
directory=/root/scripts/gtaskqueue_puller
command=/root/scripts/gtaskqueue_puller/venv/bin/gtaskqueue_puller "foo"
autostart=true
autorestart=true

[program:gtaskqueue_puller_2]
directory=/root/scripts/gtaskqueue_puller
command=/root/scripts/gtaskqueue_puller/venv/bin/gtaskqueue_puller "bar"
autostart=true
autorestart=true
而不是:

[program:gtaskqueue_puller_1]
directory=/root/scripts/gtaskqueue_puller
command=venv/bin/gtaskqueue_puller "foo"
autostart=true
autorestart=true

[program:gtaskqueue_puller_2]
directory=/root/scripts/gtaskqueue_puller
command=venv/bin/gtaskqueue_puller "bar"
autostart=true
autorestart=true

您能否提供venv/bin的绝对路径?supervisor conf提供了
目录
指令是的,我已经设置了
目录
选项。刚刚尝试在命令中使用完整路径,它正在工作。奇怪。我可以看到同样的行为——有时,即使设置了目录,主管也找不到具有相对路径的命令,并且您可以从该目录手动运行该命令。