Upgrade python in a virtualenv

If you happen to be using the venv module that comes with Python 3.3+, it supports an --upgrade option.
Per the docs:

Upgrade the environment directory to use this version of Python, assuming Python has been upgraded in-place

python3 -m venv --upgrade ENV_DIR

Leave a Comment