# Upgrade venv Python version ## Metadata **Status**:: #x **Zettel**:: #zettel/permanent **Created**:: [[2023-02-18]] ## Synopsis Take the example to upgrade from python-3.10.8 to python-3.11.2 Migrate the old venv directory. ``` python3 -m venv --upgrade .venv/python-3.10.8 ``` Delete the new venv directory and create symbol link. ``` rm -rf .venv/python-3.11.2 ln -snf python-3.10.8 .venv/python-3.11.2 ``` It's important to reserve the old directory structure. Also see the script [upgrade-venv-python.sh](https://github.com/doitian/dotfiles-public/blob/master/default/bin/upgrade-venv-python.sh) to migrate projects in batch.