NGINX/Python/Gunicorn – Failed at Step Exec – No such file or directory

I’ve set up a simple flask ask being served by NGINX and Gunicorn.

When I run Gunicorn on it’s own ( it works, so I’m sure the issue lies with my .service file. It looks like:

Description=Guncicorn server to servce mcname

ExecStart=/home/tom/mcname/mcname-env/bin/gunicorn --workers 3 --bind unix:/home/tom/mcname/mcname.sock -m 007 mcname.wsgi:app


And the output of sudo cat /var/log/syslog shows mcname.service: Failed at step EXEC spawning /home/tom/mcname/mcname-env/bin/gunicorn: No such file or directory.

Ok… but then

pwd: /home/tom/mcname/mcname-env/bin

and ls:
activate easy_install flask gunicorn_django pip pip2.7 python2 python-config
activate.csh easy_install-2.7 gunicorn gunicorn_paster pip2 python python2.7 wheel

So the file definitely does exist (/home/tom/mcname/mcname-env/bin/gunicorn) and the directory is owned by user tom who is in my .service file. I don’t understand why the .service file cannot find the gunicorn file to launch the process. Any ideas why this error is occurring?


Leave a Reply