How change default from Python 3.9 to Python 3.12 So I can Install Django 5.0.0

After undergoing cataract surgery for my right eye I am back to learning Django. I am following the tutorial at LearnDjango | LearnDjango.com. When I try to install Django I get this error message `

ERROR: Ignored the following yanked versions: 4.2.12
ERROR: Ignored the following versions that require a different python version: 5.0 Requires-Python >=3.10; 5.0.1 Requires-Python >=3.10; 5.0.2 Requires-Python >=3.10; 5.0.3 Requires-Python >=3.10; 5.0.4 Requires-Python >=3.10; 5.0.5 Requires-Python >=3.10; 5.0.6 Requires-Python >=3.10; 5.0.7 Requires-Python >=3.10; 5.0.8 Requires-Python >=3.10; 5.0.9 Requires-Python >=3.10; 5.0a1 Requires-Python >=3.10; 5.0b1 Requires-Python >=3.10; 5.0rc1 Requires-Python >=3.10; 5.1 Requires-Python >=3.10; 5.1.1 Requires-Python >=3.10; 5.1.2 Requires-Python >=3.10; 5.1.3 Requires-Python >=3.10; 5.1a1 Requires-Python >=3.10; 5.1b1 Requires-Python >=3.10; 5.1rc1 Requires-Python >=3.10
ERROR: Could not find a version that satisfies the requirement django~=5.0.0 

I have Python 3.9 and Python 3.12 install on my computer.
Short of deleting Python 3.9 how can I make Python 3.12 the default on my machine.
Or how can I get Python 3.12 into my virtual environment? Thanks for your help

What operating system are you using?

How did you install Python 3.12?

In the general case, creating a virtual environment for a particular version of python can be as direct as running the following command from the command prompt:
python3.12 -m venv my_python_312_env
(where “my_python312_env” is the path and name of the directory where you want the virtual environment created).

This assumes that python3.12 is in your path.

This is also assuming you have the “venv” module installed for that version of python.

I downloaded Python 3.12 fro the Python website and ran the installer. Yes I clicked on ADD to Path

I dont know about the venv module. But when I run

venv\Scripts\activate 

from my command prompt I see (.venv) in the prompt. The tutorial actually says to use Windows Powershell. Maybe I am slow, I seem to feel more comfortable with CMD

That activate script is activating an existing virtual environment, it does not create one. You either need to use the command I showed, or find what you did to create the environment for Python 3.9, and modify it to work with Python 3.12.

Side note: I don’t use Powershell at all when working with Python. My opinion is that it just gets in the way.