The problem For context:
- I have deployed an app with Heroku
- I have Python 3.9.2 running locally in VS Code vs Python 3.10.8 running on a Heroku machine
I am currently encountering the problems as mentioned on this thread.
I have found the solution to my problem seems to be switching python interpreters and copying my various packages to that location.
However, there is little documentation on how to do this in Heroku.
Any assistance is really appreciated :)
What I've tried Given the lack of documentation on the above, I've tried the following...
I found that the Heroku deployment was running on Python 3.10.8 runtime, whereas my local machine had been running 3.9.2.
I then added a runtime.txt in the root of the app's directory in Github that specified to use 3.9.2, but when I try and redeploy the build failed.
Following the Heroku logs, this leads me to:
-----> Building on the Heroku-22 stack
-----> Using buildpack: heroku/python
-----> Python app detected
-----> Using Python version specified in runtime.txt
! Requested runtime 'cat runtime.txt
python-3.9.2' is not available for this stack (heroku-22).
! For supported versions, see: https://devcenter.heroku.com/articles/python-support
! Push rejected, failed to compile Python app.
! Push failed
I then realise from the logs, that the build package isn't of 3.9.2 isn't supported.
I've then downloaded python 3.11.0 on my local machine (which is supported, as mentioned here).
Deactivated the current virtual environment (using 3.9.2).
Created a new virtual environment.
Rerun the app locally and checked it works.
I've then added the changes to the git repo.
Then, I've tried to deploy on Heroku. I'm now getting:
-----> Building on the Heroku-22 stack
-----> Using buildpack: heroku/python
-----> Python app detected
-----> Using Python version specified in runtime.txt
! Requested runtime 'cat runtime.txt
python-3.11.0' is not available for this stack (heroku-22).
! For supported versions, see: https://devcenter.heroku.com/articles/python-support
! Push rejected, failed to compile Python app.
! Push failed
I then navigate to the support documentation
I then try and follow the support guidance around 'Checking the buildpack version', as my version of Python is supported, as per the documentation.
I run the command against my CLI which checks which buildpack version I have. I get:
=== [appnamegoeshere] BuildPack URL
heroku/python
So, I have the 'heroku/python' buildpack.
Not sure where to go from here?
Any help is much appreciated :)