why gunicorn command not found with gunicorn installed?

前端 未结 6 879
执念已碎
执念已碎 2021-02-19 03:19

I have intalled gunicorn,but gunicorn command not found:

# pip3.4 install gunicorn
Requirement already satisfied (use --upgrade to upgrade): gunicorn in /usr/loc         


        
6条回答
  •  旧巷少年郎
    2021-02-19 04:21

    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)

提交回复
热议问题