【问题标题】:gunicorn not found on heroku在heroku上找不到gunicorn
【发布时间】:2015-05-09 06:47:11
【问题描述】:

我想在 Heroku 上部署一个非常基本的 Django 应用程序。我按照说明进行操作,但浏览器显示 Heroku 错误页面和 heroku 日志显示

bash: gunicorn: command not found

我的 requirements.txt 中有 gunicorn,并按照文档的说明配置了 wsgi.py 和 Procfile。我还能尝试什么?

编辑:我还尝试在 Heroku (heroku run pip install gunicorn) 上手动安装 gunicorn,效果很好,所以我很确定 gunicorn 已安装。为什么 Heroku 找不到?

编辑2:看来我可以手动安装gunicorn(heroku run bash 然后pip install gunicorn

~ $ gunicorn
usage: gunicorn [OPTIONS] [APP_MODULE]
gunicorn: error: No application module specified.

但是当我注销并再次登录 bash 时,我得到:

~ $ gunicorn
bash: gunicorn: command not found

Heroku 似乎安装但随后丢弃 gunicorn。怎么可能?

【问题讨论】:

  • 你能发布你的 Procfile 和 project.wsgi 文件吗?

标签: django heroku gunicorn


【解决方案1】:

您好,遇到了同样的问题,但这可能会有所帮助:

去这个:

https://github.com/heroku/heroku-buildpack-python

并尝试在项目的根终端中运行此命令:

heroku buildpacks:set git://github.com/heroku/heroku-buildpack-python.git

然后运行以下命令更新heroku:

git push heroku master

【讨论】:

  • 命令可以是heroku buildpacks:set heroku/python。这对我有用,因为我已经有一个 python 应用程序,所以我没有克隆 Heroku 的 python 应用程序模板。谢谢
猜你喜欢
  • 2015-05-12
  • 1970-01-01
  • 2019-02-05
  • 2012-05-18
  • 1970-01-01
  • 2018-09-16
  • 1970-01-01
  • 2017-04-25
  • 2016-01-06
相关资源
最近更新 更多