小编Han*_*pan的帖子

Ubuntu - Supervisord 和 virtualenv

我正在尝试从主管运行一系列 Python 应用程序。它在 Mac OSX 上运行良好,但是当我尝试在 Ubuntu 上运行相同的应用程序时,主管似乎没有激活 virtualenv,因此我的脚本抛出错误。

这是我的结构:

/home/user/Sites/my-site
- app.py
- venv
- supervisor.conf
Run Code Online (Sandbox Code Playgroud)

我的 supervisor.conf 文件如下所示:

[program:python-app]
autorestart = false
autostart = false
startsecs = 0
command = python app.py
startretries = 1
environment=PYTHONPATH="%(here)s"

[unix_http_server]
file = /tmp/supervisor.sock

[supervisord]
logfile = logs/supervisord.log
pidfile = logs/supervisord.pid
environment=PYTHONPATH="%(here)s"

[supervisorctl]
serverurl = unix:///tmp/supervisor.sock

[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[unix_http_server]
username = supervisor_admin
password = 

[inet_http_server]
username = supervisor_admin
password = 
port = *:9001
Run Code Online (Sandbox Code Playgroud)

如何让主管在虚拟环境中运行 python 应用程序?

ubuntu python virtualenv supervisord

6
推荐指数
1
解决办法
2万
查看次数

标签 统计

python ×1

supervisord ×1

ubuntu ×1

virtualenv ×1