Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

337
Views
Unable to start gunicorn.service due to import module error

I am trying to start Gunicorn from systemd service file, but I get import module error. How can I fix it?

My gunicorn service file:

[Unit]
Description=gunicorn daemon
After=network.target

[Service]
User=sammy
Group=www-data
WorkingDirectory=/home/sammy/myproject
ExecStart=/home/sammy/myproject/venv/bin/gunicorn --workers 3 --bind unix:/home/sammy/myproject/myproject.sock myproject.wsgi:application

[Install]
WantedBy=multi-user.target

When I execute gunicorn --bind 0.0.0.0:8000 myproject.wsgi:application, there is no error.

But when I use

sudo systemctl start gunicorn
sudo systemctl enable gunicorn

I get this error:

ImportError: No module named 'myproject'

What is wrong?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

It is probably a directory permission problem. Make sure the user sammy is in the www-data group and set the home directory permissions with a chmod 710.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!