19π
I faced the same issue and it turns out I had to add gunicorn binary path to Linux PATH variable. You can start by echoing $PATH to see all binary path listed on the system. Then find out where gunicorn is installed. For my case I was using python virtual environment and pyenv which helps manage several python versions and dependencies separately.
(venv3.6) dave@daverig (develop)β % pip show gunicorn
Name: gunicorn
Version: 19.7.1
Summary: WSGI HTTP Server for UNIX
Home-page: http://gunicorn.org
Author: Benoit Chesneau
Author-email: benoitc@e-engura.com
License: MIT
Location: /home/dave/.pyenv/versions/3.6.2/envs/venv3.6/lib/python3.6/site-packages
Notice gunicorn is installed in /home/dave/.pyenv/versions/3.6.2/envs/venv3.6/lib/python3.6/site-packages
and the corresponding path for the binaries for this particular python version is at /home/dave/.pyenv/versions/3.6.2/envs/venv3.6/bin
. So I had to add that to Linux path via ~/.profile
file like so;
export PATH=$PATH:$HOME/.pyenv/versions/3.6.2/envs/venv3.6/bin
then ofcourse you want to refresh this using source ~/.profile
or restart your terminal. Once I was able to do this, gunicorn binary was now available on my console;
(venv3.6) dave@daverig (develop)β % gunicorn --version
gunicorn (version 19.7.1)
15π
I had the same problem on Debian.
It turns out that on Debian the documentation advises to install gunicorn via apt:
$ sudo apt install gunicorn
- [Django]-About 20 models in 1 django app
- [Django]-Disconnect signals for models and reconnect in django
- [Django]-Django β New fonts?
6π
Installing gunicorn
from source saved me after 2 hours trying!
pip3 install git+https://github.com/benoitc/gunicorn.git
- [Django]-Django aggregate or annotate
- [Django]-How do I restart celery workers gracefully?
- [Django]-XlsxWriter object save as http response to create download in Django
5π
i just created a file named gunicorn and type these codes below which is the same as my development server , and included it into system path,such as /usr/bin
#!/usr/local/bin/python3.4
#-*- coding: utf-8 -*-
import re
import sys
from gunicorn.app.wsgiapp import run
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$','',sys.argv[0])
sys.exit(run())
in this way, it solved my problem,but still confused me,why gunicorn command not generated and included into system path automatically?and why my development server did ,both the same OS (centos 6.5 x64)
- [Django]-How to format time in django-rest-framework's serializer?
- [Django]-Django: How to get language code in template?
- [Django]-Django and read-only database connections
1π
If you installed python3 from source compiled, you should export your python3 PATH:
export PATH=$PATH:/usr/local/python3/bin
- [Django]-How to redirect on conditions with class based views in Django 1.3?
- [Django]-Whats the difference between Django models and forms?
- [Django]-Django Forms with ReactJS
0π
Are you use python3.4-venv?
if true
- Delete
env
folder - Just reinstall:
python3.4-venv
. Ex for ubuntu:
apt install python3.4-venv
- Exec:
python3.4 -m venv env
source env/bin/activate
- reinstall gunicorn by :
pip3 install gunicorn
or install fromrequirements.txt
bypip3 install -r requirements.txt
- [Django]-Django create userprofile if does not exist
- [Django]-Django query case-insensitive list match
- [Django]-How to delete cookies in Django?
-3π
go to terminal and change directory to environment and then type the below command.
pip install gunicorn
#Enjoy1
- [Django]-Exclude fields in Django admin for users other than superuser
- [Django]-PyCharm not recognizing Django project imports: from my_app.models import thing
- [Django]-Can the Django ORM store an unsigned 64-bit integer (aka ulong64 or uint64) in a reliably backend-agnostic manner?