I have a Heroku Python project that is emitting errors that I can't reproduce locally. I suspect that the Python virtualenv in the Heroku deployment is corrupted in some way.
Is there a way to clean the Python virtualenv in a Heroku project and start fresh?
See Heroku docs. Create a runtime.txt file with a different version of Python than your current version and push to heroku. This will purge your appication's build cache and virtualenv. Then you can revert to your previous Python version in the runtime.txt and push that up to Heroku, giving you both your desired Python runtime and a clean virtualenv.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With