Python classic buildpack now rejects existing virtual environment directories
Change effective on 09 December 2025
The Python classic buildpack, used by Cedar-generation apps, will now fail the build if an existing Python virtual environment named .venv/ or venv/ is found in the build directory. This error replaces the warning which had been displayed in build logs since 2nd September 2025.
Python virtual environments are specific to a single machine and so won’t normally work when run somewhere else. As such, they should never be committed to your Git repository, since doing so can cause unexpected errors and bloat the size of your Git repo and slug.
If the build of your Python app now fails with an error due to an existing virtual environment directory being found in your app source, you must follow the instructions provided in the error message to remove the directory from your Git index and add an entry for it to your .gitignore file.