Agent skill
pyenv-activation
Guide for activating pyenv virtual environments with troubleshooting for common issues
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/pyenv-activation
SKILL.md
Pyenv Activation Skill
This skill should be used when activating pyenv virtual environments or troubleshooting pyenv activation issues.
Purpose
Activate pyenv virtual environments reliably, with fallbacks when standard activation methods fail.
Activation Methods
Method 1: Standard Activation (Preferred)
pyenv activate <env-name>
This requires pyenv-virtualenv to be loaded into the shell.
Method 2: Shell Re-initialization
If pyenv-virtualenv is not loaded:
eval "$(pyenv init -)" && eval "$(pyenv virtualenv-init -)" && pyenv activate <env-name>
Method 3: Direct Virtual Environment Activation
When pyenv activation fails or shell integration is not enabled, activate the virtual environment directly using its path:
source /Users/alexismanuel/.pyenv/versions/<python-version>/envs/<env-name>/bin/activate
To find the correct path:
- Run
pyenv versionsto list available environments - Note the Python version and environment name
- Construct the path:
~/.pyenv/versions/<version>/envs/<env-name>/bin/activate
Troubleshooting
| Error | Cause | Solution |
|---|---|---|
| "pyenv-virtualenv has not been loaded" | pyenv-virtualenv plugin not initialized | Use Method 2 |
| "shell integration not enabled" | pyenv shell integration not configured | Use Method 3 |
| Activation appears to work but wrong Python version | Environment not properly activated | Verify with python --version and which python |
Verification
After activation, always verify the environment is active:
python --version
which python
Expected output should show the Python version from the pyenv environment and a path under ~/.pyenv/versions/.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?