Skip to content

Latest commit

 

History

History
97 lines (69 loc) · 1.43 KB

ReadMe_static.md

File metadata and controls

97 lines (69 loc) · 1.43 KB

ReadMe_static

Setting up visual studio for python

Virtual Env Configuration

Using python3

Create a directory workspace

mkdir -p ~/workspace/proj
cd ~/workspace

Create a virtual env

python3 -m venv venv
$ ls
proj venv

Now you can open visual studio from terminal and the python environment should be activiated

cd ~/workspace
code .

Validate

which python3
which pip3

Output

./venv/bin/python3
./venv/bin/python3

Using virtualenv

which python3
which pip3

Output

/opt/homebrew/bin/python3
/opt/homebrew/bin/pip3
mkdir tmp
virtualenv -p $(which python3) ./tmp
source ./tmp/bin/activate

You should see the environment at the bottom bar in VS Code

code .

Output (showing)

./tmp/bin/python3
./tmp/bin/pip3

Deactivate

deactivate

Extensions

Python IntelliCode Pylance