Python development cheat sheet

I am starting to experiment with Python 3 and setting up the environment is my pain point. So here’s my cheat sheet.

General Python

pip3 install virtualenv Installs virtual environment for Python 3.

virtualenv virtualenv-name Creates a named virtual environment.

source virtualenv-name/bin/activate  Activates virtual environment.

deactivate  Deactivates virtual environment.

pip install package  Installs package, inside virtual environment for Python 3, outside for Python 2.

Setting up VS Code’s workspace for an virtual environment

  1. find Python Path in Workspace settings
  2. write a path to your virtual environment  ${workspaceFolder}/../virtualenv-name/bin/python
pip install flask  Installs flask.