Gunicorn with Flask using wrong Python

前端 未结 4 628
[愿得一人]
[愿得一人] 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条回答
  •  闹比i
    闹比i (楼主)
    2021-02-04 02:34

    I have the same problem as You. The problem is that gunicorn for some reason load the enviroment outside your virtual env. I solved by uninstalling the package gunicorn outside virtual enviroment;

    (env) $ deactivate
    $ sudo pip uninstall gunicorn
    

    So you come back to your env and try to run. In my case env folder I typed:

    $ source env/bin/activate
    (env) $ pip install gunicorn
    (env) $ gunicorn server:app
    2013-10-19 20:40:56 [11923] [INFO] Starting gunicorn 18.0
    2013-10-19 20:40:56 [11923] [INFO] Listening at: http://127.0.0.1:8000 (11923)
    2013-10-19 20:40:56 [11923] [INFO] Using worker: sync
    2013-10-19 20:40:56 [11926] [INFO] Booting worker with pid: 11926
    

提交回复
热议问题