Skip to content

My Python Development Environment

Install Tools @macOS

Info

This is a from scratch to start a development environment in macOS. I am writing this in macOS Sonoma V14.0

Install oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Install brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install --cask visual-studio-code
brew install [email protected]
brew install pipx
brew install pyenv
python3 --version
pipx install poetry
pipx install poetry-plugin-export
pipx install poethepoet
pipx inject poetry poethepoet
pipx inject poetry poetry-plugin-export
pipx runpip poetry uninstall <poetry-plugin>

Add VSCode Extensions

code --list-extensions
code --list-extensions | xargs -L 1 echo code --install-extension
ms-python.black-formatter
ms-python.python
ms-python.vscode-pylance
code --install-extension <extension-name>
code --install-extension ms-python.black-formatter
code --install-extension ms-python.python
code --install-extension ms-python.vscode-pylance

Start a project

Create new project
poetry use <python-version>
poetry new <project-name>
Initialize from existing project
cd <project-directory>
poetry use <python-version>
poetry init

And the rest is in Starting a Python Project