- Task
- Version · 6.0
- Deliver
Recreate your Python virtual environment for Python 3.12
Last updated: September 29, 2026
Uses
As of Liquibase Secure 6.0, the embedded Python runtime is Python 3.12 (GraalPy 25.0.2). If you run custom policy checks with your own virtual environment using --script-python-executable-path, a virtual environment created with an earlier version of GraalPy targets Python 3.11 and fails with ModuleNotFoundError when a policy check runs. Recreate your virtual environment with GraalPy 25.0.2 to continue running custom policy checks.
User group | Action required |
|---|---|
Points | Recreate the virtual environment with GraalPy 25.0.2. Follow the steps below. |
Uses built-in checks only (no custom virtual environment) | None. |
Writes custom checks using the embedded VFS | None. The VFS is rebuilt automatically. |
Procedure
Save your installed modules
Save your existing virtual environment's module list to a file so you can reinstall it later.
Be sure to:
Replace
your_venv_pathwith the path to your existing virtual environment. For example,/opt/liquibase/venv
Install Python 3.12
Install Python 3.12 on the machine that runs Liquibase, if it is not already installed. Use your OS package manager, pyenv, or the official Python installer.
Rename your existing virtual environment
Rename the old virtual environment so the new one can be created at the same path. You can delete the .bak copy after you verify the new environment works.
Be sure to:
Replace
your_venv_pathwith the path to your existing virtual environment. For example,/opt/liquibase/venv
mv your_venv_path your_venv_path.bak
Create the new virtual environment
Create the virtual environment with Python 3.12 at the same path as before. Because the path does not change, your --script-python-executable-path configuration does not change.
Be sure to:
Replace
your_venv_pathwith the same path your Liquibase configuration points to. For example,/opt/liquibase/venv
python3.12 -m venv your_venv_path
Reinstall your modules
Reinstall the modules you saved in Step 1 into the new virtual environment.
Be sure to:
Replace
your_venv_pathwith the path to your new virtual environment. For example,/opt/liquibase/venv
Verify
Run one of your custom policy checks. If you receive ModuleNotFoundError, see Troubleshoot ModuleNotFoundError for custom policy checks.