无法让gunicorn使用Python 3

2024-05-19

我有 Ubuntu+NGINX+Gunicorn 以及可与 Python 3 设置配合使用的虚拟环境,但我的 Flask 应用程序仍然以 2.7.6 运行。我已系统地按照说明进行操作,但找不到解决方案。

Gunicorn 配置文件

[program:app-server]
command = gunicorn app:app -b localhost:8000
directory = /home/www/app-server
user = appuser

项目目录结构

app-server    
----app.py
----venv (virtual environment)

Gunicorn 本身就是一个 Python 应用程序; Gunicorn PPA 仅发布Python 2版本。

您可以将 Gunicorn 安装到 Python 3 中(使用pip,最好进入您的 virtualenv)并运行该版本:

/home/www/app-server/venv/bin/gunicorn
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

无法让gunicorn使用Python 3 的相关文章

随机推荐