Generally, you wouldn’t do this. The purpose of the {dependency}=={version}
lines in the requirements.txt
is to pin your application to using the listed version of that dependency.
What you may find if you don’t specify the version, both whilst learning and if you go on to build apps that others will use, is that later versions than the one you used during development may contain “breaking changes”. If some functionality that you’ve assumed results in “A” gets changed to result in “B” in a later version, then pulling that later version will break your code.
Pinning the version you used to create the app means that your code can be installed, and run, anywhere and work how it did when you wrote it.
Yes, you’d need to completely remove the dependency on pywin32
for it to build on Heroku; there is no version of that library available that Heroku can pull and install. If it’s included in any form in your requirements.txt
, it will break the build on Heroku.
Right, ok. I’ve watched the video, though I’ve not done the entire path so this might have been covered earlier…
I think that they’ve omitted a step which you may need to do.
I am presuming that you’ve completed the entire video, and so you have a Procfile
in the directory which looks like this:
web: gunicorn app:app
The Procfile tells Heroku what process types you want to run, and what the command each of them should execute at launch is meant to be. In this case, we’re defining a web
process which should run gunicorn app:app
at boot.
What they don’t appear to have included is the step to scale up your web dyno so that your web process is running.
If you go to your app dashboard on Heroku, you should see the following section:

(Don’t worry that my web
process is different to yours, this is a static HTML app I’m using as an example not a Python one.
)
In my example above, the dyno is already running - hence why it says “ON”. Yours may say “OFF”, in which case the following steps will fix it.
Click the “Configure Dynos” link, and you’ll be taken to this page:
Click the button with the pencil icon, and you’ll be able to toggle the dyno on or off. Switch it on, then click “Confirm”:
At this point, your web process will be running and should respond to requests.
If that’s not the problem (for example if your dyno is already running), let me know - but this doesn’t seem to be done in the video that I saw. (I didn’t go through it at 1x speed!)