skip to Main Content

I have a Python script open in VSC. I have a venv (Python 3.10.0) selected as the Kernel. In terminal I have the following line:

PS C:Usersperson123DesktopProjectvenv>

I think my venv is not activated. Am I correct and how to activate it? The instruction tricks I’ve seen (for example this venvScriptsactivate) don’t activate this venv. Thanks for your assistance.

2

Answers


  1. Looks like you are using powershell. To activate your venv, you should run the activate.ps1 script:

    .venvScriptsactivate.ps1
    

    And to check if it is properly activated, check the path of your python executable:

    (Get-Command python).Path
    

    It should point to your python venv.

    Login or Signup to reply.
  2. Selecting an interpreter by shortcuts "Ctrl+Shift+P" and type "Python: Select Interpreter" in vscode, environment will be automatically activated when you run the python script.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search