Why does my Python virtual environment use a different Python version than system Python?

5 days ago 9
ARTICLE AD BOX

I created a virtual environment using:

python -m venv venv

My system Python version is:

python --version Python 3.11.1

But after activating the virtual environment, I get:

(venv) python --version Python 3.10.12

Why is the virtual environment using a different Python version than the system Python?

How can I make sure the virtual environment uses a specific Python version?

OS: macOS / Linux

Python installed via system package manager

Read Entire Article