Gunicorn with Flask using wrong Python

前端 未结 4 627
[愿得一人]
[愿得一人] 2021-02-04 02:30

I\'m trying to bootstrap a Flask app on a Gunicorn server. By putting the two tools\' docs together, plus searching around on SO, this is what I have so far... but it\'s not qui

4条回答
  •  深忆病人
    2021-02-04 02:46

    The gunicorn utility may be running out of the system path rather than your virtualenv.

    Make sure to pip install gunicorn into the virtualenv.

    Here's the pip freeze of a virtualenv I setup to run your app:

    (so_2)20:38:25 ~/code/tmp/flask_so$ pip freeze
    Flask==0.10.1
    Flask-SQLAlchemy==1.0
    Jinja2==2.7.1
    MarkupSafe==0.18
    SQLAlchemy==0.8.2
    Werkzeug==0.9.4
    gunicorn==18.0
    itsdangerous==0.23
    wsgiref==0.1.2
    

    In reality, I only ran these pip installs:

    $ pip install flask
    $ pip install gunicorn
    $ pip install Flask-SQLAlchemy
    

提交回复
热议问题