Zyzle.dev
;

Python Project Basic Setup

17th March, 2023

Simple setup of venv for new Python projects, I would always use a local venv for developing in Python as it makes it easier to manage dependencies and work in the app across multiple locations.

The setup process of venv may have changed since this guide was written, check out the current docs for updates1

Terminal window
mkdir myproject
cd !$
python3 -m venv env
. env/bin/activate
; pip is almost always out of date so upgrade it
python -m pip install --upgrade pip
; git init and ignore env
git init
echo "env/" >> .gitignore

Footnotes

  1. Python Documentation - venv