pyenv
Files
SKILL.mdagentsreferences
Install
Install the containing plugin
/plugin install ci-cd@llm-skills
Invoke this skill after installation
/ci-cd:pyenv
This skill is bundled inside ci-cd. Install the plugin once, then Claude Code can use any of its included skills. Browse the full plugin repository at github.com/alisonaquinas/llm-ci-dev.
SKILL.md
name: pyenv description: Manage multiple Python versions with pyenv. Use when tasks mention pyenv, Python version switching, .python-version, or pyenv-virtualenv.
pyenv
Intent Router
| Request | Reference | Load When |
|---|---|---|
| pyenv-installer, Homebrew, build dependencies, shell integration | references/install-and-setup.md | pyenv needs to be installed or the shell integration is missing |
| install/global/local/shell/versions/which commands | references/command-cookbook.md | Specific pyenv commands are needed |
| pyenv-virtualenv plugin, virtualenv creation, auto-activation | references/virtualenvs.md | Virtual environment management with pyenv is the topic |
| .python-version, shell > local > global, PYENV_VERSION | references/project-files.md | Project-level Python version pinning or precedence is the topic |
Quick Start
# Install Python 3.12.3
pyenv install 3.12.3
# Set as global default
pyenv global 3.12.3
# Pin version for a project (writes .python-version)
pyenv local 3.12.3
# Confirm active version
pyenv version
Core Command Tracks
- Install Python:
pyenv install 3.12.3 - Global default:
pyenv global 3.12.3 - Project pin:
pyenv local 3.12.3(writes.python-version) - Shell override:
pyenv shell 3.11.9(current shell only) - List installed:
pyenv versions - List available:
pyenv install --list - Resolve binary:
pyenv which python
Safety Guardrails
- Install OS build dependencies before running
pyenv installto avoid compilation failures. - Commit
.python-versionto version control so all contributors use the same Python. - Use
pyenv-virtualenvfor project-level virtual environments rather than system venv directly. - Set
PYENV_VERSIONin CI only if.python-versionis not present in the repository.
Workflow
- Install build dependencies for the OS (see
references/install-and-setup.md). - Install the target Python:
pyenv install <version>. - Set global default:
pyenv global <version>. - For a project,
cdinto the directory and runpyenv local <version>. - Create a virtualenv:
pyenv virtualenv <version> <name>and activate it.
# Troubleshoot: python command resolves to wrong version, force-reinitialize shims
pyenv which python
pyenv rehash
pyenv version
Related Skills
- pip — Python package installer used within pyenv-managed environments
- poetry — dependency and virtualenv manager that works with pyenv
- pipenv — Pipfile-based environment manager that integrates with pyenv
- asdf — universal version manager that also handles Python
References
references/install-and-setup.mdreferences/command-cookbook.mdreferences/virtualenvs.mdreferences/project-files.md- Official repo: https://github.com/pyenv/pyenv
- Common build problems: https://github.com/pyenv/pyenv/wiki/Common-build-problems
- Full command reference: https://github.com/pyenv/pyenv/blob/master/COMMANDS.md