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
Looks like you are using powershell. To activate your venv, you should run the
activate.ps1
script:And to check if it is properly activated, check the path of your python executable:
It should point to your python venv.
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.