Skip to content

Instantly share code, notes, and snippets.

@martin-kokos
Created July 5, 2025 14:32
Show Gist options
  • Save martin-kokos/d59545c6ad50116ff70d07fb214022ae to your computer and use it in GitHub Desktop.
Save martin-kokos/d59545c6ad50116ff70d07fb214022ae to your computer and use it in GitHub Desktop.
Audit python virtual environments

Venvs can go stale. Find venvs with old python versions. Using the pyenv.cfg file works across venv, poetry, etc.

$ find ~ -name pyvenv.cfg |xargs grep -h executable |sort | uniq -c
     11 base-executable = /usr/bin/python3.10
     56 base-executable = /usr/bin/python3.11
     26 base-executable = /usr/bin/python3.12
      6 base-executable = /usr/bin/python3.13
      5 base-executable = /usr/bin/python3.9
      1 base-executable = /usr/lib/python-exec/python3.11/python3
      5 base-executable = /usr/lib/python-exec/python3.6/python
      4 executable = /usr/bin/python3.12
     13 executable = /usr/bin/python3.13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment