estoy usando supervisor para ejecutar un script en Python:Supervisor - Ejecución de un script en Python tema PYTHONPATH
[program:twitter_track]
autorestart = true
numprocs = 1
autostart = false
redirect_stderr = True
stopwaitsecs = 1
startsecs = 1
priority = 99
command = python /home/ubuntu/services/twitter.py track
startretries = 3
stdout_logfile = /home/ubuntu/logs/twitter_track.log
embargo, el proceso no puede iniciarse. Esto es lo que dice el registro de errores:
Traceback (most recent call last):
File "/home/ubuntu/services/twitter.py", line 6, in <module>
from mymodule.twitter.stream import TwitterStream
ImportError: No module named mymodule.twitter.stream
Traceback (most recent call last):
File "/home/ubuntu/services/twitter.py", line 6, in <module>
Parece que obtener mimodulo, pero si me quedo twitter.py por sí mismo, todo funciona bien, sólo se lanza este error cuando se ejecuta a través del supervisor.
he añadido a la mimodulo PYTHONPATH en mi archivo ~/.profile así:
export PYTHONPATH=$PYTHONPATH:/home/ubuntu/lib
¿Hay alguna razón por la que el guión iba a funcionar cuando se ejecuta a través del terminal, pero no cuando se ejecuta a través supervisor? Cualquier ayuda sería apreciada.