Procfile not found, Heroku python app

落爺英雄遲暮 提交于 2019-12-02 19:10:28

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

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.

Example solution (from qn):

echo "web: python app.py" > Procfile

The problem is most likely an extension issue. For example, in Windows, a file saved in notepad has a .txt extension by default. However, when you echo it into a file, the file is saved with the right name, in this case: Procfile.

I'm writing this because someone I know had the same problem and this may help others having the same issue.

After spending a significant amount of time on this.. I thought it was important to share..

In the root of your directory => touch Procfile git add git commit git push

make sure your Procfile on github is "Procfile" not "procfile"

git push heroku master

It must be the proper case both locally and on github in order for heroku to recognize it.

delete the .git file from the folder, and try adding your files to git again using the following commands-

git init

git add .

git commit -m "Procfile issue resolved"

heroku git:remote --app yourappname

git push heroku master

heroku open

hope this helps....

I had the same problem but in laravel. As stated above, some text editors e.g Notepad will add the .txt extension by default if you do not specify the file extension.

Therefore you will have Procfile.txt file instead of Procfile file which Heroku will not detect

To avoid this extension addition, use Sublime text editordownload sublime free it will save it without the .txt extension

The easiest way to create a procfile, (without using the IDE and running into problems with the file extension), is to run this code in your terminal.

touch procfile

If you look up "touch", it's actually meant to simply update the timestamp of an existing file, but a handy by-product, is that it CREATES a file, if there isn't one there in the first place.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!