Procfile not found, Heroku python app
Asked Answered
T

6

20

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).

Contents of Procfile are:

web: python app.py

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

Cheers, Thain

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

echo "web: python app.py" > Procfile

worked after that, thanks.

Trimester answered 3/4, 2013 at 14:51 Comment(3)
maybe close this then?Mowbray
this just worked for me as well after over an hour of trying to find an answer to this problemSparhawk
8 people have upvoted this question, implying there is a common issue of some sort. Maybe you could post an answer to your own question explaining what was different with your editor? If I create such a file with vim, it would be identical to the results of that echo command - so, what editor did you use, how did the saved file differ from the one that worked? Does your editor force Unicode, or add a file extension you didn't notice?Rozanneroze
S
17

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
Sully answered 23/7, 2014 at 8:49 Comment(0)
S
5

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.

Spooner answered 25/7, 2014 at 21:42 Comment(0)
M
3

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.

Maleki answered 18/10, 2015 at 6:36 Comment(0)
K
3

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....

Klimesh answered 12/11, 2017 at 13:33 Comment(0)
V
0

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

Verboten answered 24/1, 2015 at 6:2 Comment(0)
A
0

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.

Anapest answered 20/5, 2015 at 11:31 Comment(1)
This will fail as it has to be Procfile with first capital letterMarelya

© 2022 - 2024 — McMap. All rights reserved.