Setting up visual studio for python
Create a directory workspace
mkdir -p ~/workspace/proj
cd ~/workspaceCreate a virtual env
python3 -m venv venv$ ls
proj venvNow you can open visual studio from terminal and the python environment should be activiated
cd ~/workspace
code .Validate
which python3
which pip3Output
./venv/bin/python3
./venv/bin/python3which python3
which pip3Output
/opt/homebrew/bin/python3
/opt/homebrew/bin/pip3mkdir tmp
virtualenv -p $(which python3) ./tmp
source ./tmp/bin/activateYou should see the environment at the bottom bar in VS Code
code .Output (showing)
./tmp/bin/python3
./tmp/bin/pip3Deactivate
deactivate