I solved the issue by switching to Docker builds.
heroku.yml to the root of my project:
build: docker: web: Dockerfile run: web: python app.py
pip upgrade happens in the
FROM python:3.7-slim ... RUN pip install --upgrade pip RUN pip install --no-cache-dir -r requirements.txt ...
#3 Don’t forget to change the type of your Heroku app:
heroku stack:set container --app YOUR_APP_NAME
This way I was able to control both the
Python and the
pip version. Prior to moving to the Docker deployments I tried upgrading Python to the latest stack in Heroku (through
runtime.txt), but to no avail:
pip won’t get upgraded beyond