Skip to content

Instantly share code, notes, and snippets.

@mbiemann
Last active February 22, 2022 14:35
Show Gist options
  • Save mbiemann/b0713111f7fc00f21757d831c7759955 to your computer and use it in GitHub Desktop.
Save mbiemann/b0713111f7fc00f21757d831c7759955 to your computer and use it in GitHub Desktop.
Python Development Environment

Python Development Environment

This tutorial will install:

  1. Homebrew
  2. pyenv
  3. venv

Pre-requirements

  • macOS with zsh

Install Homebrew

w.i.p....

Install and configure pyenv

w.i.p....

Create a Python Virtual Environment (venv)

  1. Go to the folder of the project and create the virtual environment:
$ cd /my/path/of/my/project
$ python -m venv .venv

This command will create the folder .venv inside the folder of the project with the version of the Python choosed.

  1. Activate the virtual environment:
$ source .venv/bin/activate

Commands to execute inside virtual environment:

  • which python To validate the location of virtual environment python
  • python --version To check the version of virtual environment python
  • deactivate To get out of the virtual environment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment