Solving Python gunicorn heroku error – Couldn’t find that process type, Heroku

Python gunicorn heroku error – Couldn’t find that process type, Heroku is an error which occurs when you deploy an app on Heroku, most of the errors are related to the Procfile file.

Today, I will explain why this error takes place and how to fix it, while also presenting the steps in detail and adding other solutions that could solve the error.

Exploring the Python gunicorn heroku error – Couldn’t find that process type, Heroku

This is an error which occurs when you deploy an app on Heroku, most of the errors are related to the Procfile file.

Please do not mix between multiple errors. Check if the error message looks like the error message bellow.

                                                                       #
couldn't find that process type
                                                                       #

Bellow, we will take care of the error using multiple possible methods according to your needs.

Solution 1 : Edit the Procfile file and Put it in the correct location

We have already established the fact that this error happens because of many reasons. As a result, fixing this error will need a lot of troubleshooting.

So please try all the methods in this post, I believe at least one of them might solve your problem.

First, you should make sure Procfile is in the root directory of your repo.

Make sure Procfile in Not in a folder inside the directory.

Also, edit Procfile so that there is an empty space before gunicorn

                                                                       #
web: gunicorn --pythonpath myscript app.wsgi
# notice the empty space before gunicorn
                                                                       #

Instead of combining web: and gunicorn together. Like in the example bellow.

                                                                       #
web:gunicorn --pythonpath myscript app.wsgi
                                                                       #

If the above did not work you might have a naming problem. We will discuss that more in the next section.

Solution 2 : Correctly create and name Procfile before deploying to Heroku

Do not make the mistake of naming Procfile something like Procfile.txt or some other extension.

To make sure everything is in place and done correctly.

Please, delete the Procfile file then commit the changes.

Open cmd as admin and run notepad Procfile and add the following to it. myscript should be replaced with the name of your script.

                                                                       #
web: gunicorn myscript:app
                                                                       #

Commit the changes again and Finally run the command bellow to deploy to Heroku

                                                                       #
git push heroku master
                                                                       #

I hope the methods above fixed your problem. Thank you so much for reading this post to the end.

Summing-up : 

Here we are at the end of the road, at the end of this article, if you solved this error congrats, this was a confusing error for me the first time I encountered it.

Thank you for reading my blog post to the end, If you want to learn more about the Python programming language, check out the official Python Documentation : https://docs.python.org/3/