Sadly, there are many, many ways to install and set up your Python environment, each with its own pitfalls.
This is a quick cheat sheet for one of the simplest and most reliable ways to set up Python 3.11+ and Poetry 2.0+ (what you should use as of 2025) using pyenv and pipx.
For macOS:
brew update
brew install pyenv pipxFor Ubuntu:
curl https://pyenv.run | bash
apt install pipxNow you can install a current Python and Poetry:
pyenv install 3.12.9 # Pick the version you want.
pipx install poetryFor Windows or other platforms, see the pyenv and poetry instructions (and I'd love a PR to help me update these instructions for Windows!).
-
Fork this repo (having your own fork will make it easier to contribute).
-
Check out the code.
-
Install the package dependencies:
poetry install
Developer setup:
# To run a shell within the Python environment:
poetry shell
# Thereafter you can run tests.
# To run tests:
pytest # all tests
pytest -s src/module/some_file.py # one test, showing outputs
# Build wheel:
make build
# Linting and testing:
make lint
make test
# Poetry dependency management commands:
# Upgrade all dependencies:
poetry up
# Update poetry itself:
poetry self update