Debugging Kubernetes

23 Jul 2024

Helpful tips for debugging applications running in k8s

build/k8s.png

Handling multiple errors in Rust iterator adapters

17 Dec 2023

Approaches for handling multiple errors within iterator adapters

build/rust.png

Better FastAPI Background Jobs

29 Aug 2022

A more featureful background task runner for Async apps like FastAPI or Discord bots

build/fastapi_logo.png

Useful Linux Examples

21 Dec 2021

A plethora of helpful tips for working in Linux

build/bash_logo.png
Continue to all blog posts

Python Environments

Setting up specific python version

pyenv

Install prerequisites (so that we can build Python later)

Use pyenv-installer to get pyenv

Follow instructions at end of install to add to load path

Check it’s all working with:

$ pyenv doctor

Great article from Real Python on pyenv which explains a lot about how to use pyenv

Typical workflow

# Make sure I have an up to date list of python versions
pyenv update

# find options for exact python version to install
pyenv install --list | grep 3.8

# install exact python version I want
pyenv install 3.8.7

# create virtualenv
pyenv virtualenv 3.8.7 environment_name

# activate
pyenv activate environment_name
pyenv deactivate
# activate in this directory and sub-directories
pyenv local environment_name

Then I can point PyCharm at my environment by selecting existing virtualenv with path:

# while <environment_name> is active
pyenv which python 

See also