本文介绍了未找到 Procfile,Heroku python 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在做 heroku python 演示时遇到了 Procfile 的问题.我将它放在正确的目录中(与 requirements.txt、venv/和 app.py 一起),并且该文件是Procfile",没有 .txt 扩展名(正如其他问题所建议的那样).

Doing the heroku python demo and having problems with Procfile. I have it in the right directory (alongside requirements.txt, venv/, and app.py) and the file is "Procfile" without .txt extension (as other questions suggest).

Procfile 的内容是:

Contents of Procfile are:

web: python app.py

尽管如此,我在运行foreman start"时不断收到Procfile does not exist"错误.尽我所能,任何建议将不胜感激.

Nonetheless, I keep getting the "Procfile does not exist" error when running "foreman start." At my wits end, any suggestions would be appreciated.

干杯,塞恩

重试使用 echo 命令而不是编辑器创建Procfile" -

Retried creating "Procfile" using echo command rather than an editor -

echo "web: python app.py" > Procfile

在那之后工作,谢谢.

推荐答案

只需添加一个答案即可关闭(或从未回答的问题部分移出).

Just adding an answer so that this can be closed (or moved from the unanswered questions section).

如评论中所述,尝试使用 echo 命令而不是编辑器来创建文件.我怀疑这是因为大多数编辑器添加了换行符,heroku 很难处理.

As noted in the comments, try using the echo command to create the file rather than an editor. I suspect that this is because of a newline char added by most editors that heroku is having a difficult time with.

示例解决方案(来自 qn):

Example solution (from qn):

echo "web: python app.py" > Procfile

这篇关于未找到 Procfile,Heroku python 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-24 09:35