skip to Main Content

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


  1. 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

    Login or Signup to reply.
  2. You are creating virtual environment with python3 but checking version with just python. I want you to check if python and python3 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.

    $ python -m venv virtual
    

    Or you can create virtual environment with specifing the path of your python 3.11 executable file.

    $ C:/path/to/your/python3-11-execuatable/python.exe -m venv virtual
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search