gunicorn command not found, but it’s in my requirements.txt

I also have Pipfile and Pipfile.lock files

That’s your problem: you’re using two different tools that, partly, do the same thing.

If you have a Pipfile and Pipfile.lock, Heroku uses Pipenv to install your dependencies, and your requirements.txt will be ignored.

In the absence of a Pipfile and Pipfile.lock, Heroku uses pip to install dependencies from requirements.txt.

Pick a single tool and use it everywhere. If you choose Pipenv, make sure all of your dependencies are reflected in your Pipfile and Pipfile.lock (e.g. by running pipenv install -r requirements.txt), delete your requirements.txt, and redeploy. If you want to use pip, get rid of your Pipfile and Pipfile.lock.

Leave a Comment