In VS Code (Windows), my python interpreter points to version 3.11.
python -V
in terminal gives me Python 3.11.0
I create a virtual environment with python3 -m venv virtual
called virtual, and activate it with .virtualScriptsactivate
.
Now in my environment, checking python -V
gives me Python 3.9.13 instead.
How do I get venv to create a Python 3.11 environment?
2
Answers
In the view tab above click on Comand palette> python interpreter from there you can select python 3.11, otherwise you can add it by clicking on enter interpreter path and then select the path where python 3.11 is located at
You are creating virtual environment with
python3
but checking version with justpython
. I want you to check ifpython
andpython3
are pointing same python executable file before creating virtual environment.May be try creating virtual environment using just
python
, since its version is 3.11.0.Or you can create virtual environment with specifing the path of your python 3.11 executable file.