microsoft/vscode-python-environments/python-manager-discovery
Claude Code and agent skill by microsoft/vscode-python-environments
- vendor
Checking that the SKILL.md file is still in the repository.
Environment manager-specific discovery patterns and known issues. Use when working on or reviewing environment discovery code for conda, poetry, pipenv, pyenv, or venv.
Install
npx vskill@latest install microsoft/vscode-python-environments/python-manager-discoverySKILL.md
The same SKILL.md was published earlier as microsoft/vscode-python-environments/python-manager-discovery.
Environment Manager Discovery Patterns
This skill documents manager-specific discovery patterns, environment variable precedence, and known issues.
Manager Quick Reference
| Manager | Config Files | Cache Location | Key Env Vars | |
|---|---|---|---|---|
| Poetry | poetry.toml, pyproject.toml, config.toml | Platform-specific | POETRY_VIRTUALENVS_IN_PROJECT, POETRY_CACHE_DIR | |
| Pipenv | Pipfile, Pipfile.lock | XDG or WORKON_HOME | WORKON_HOME, XDG_DATA_HOME | |
| Pyenv | .python-version, versions/ | ~/.pyenv/ or pyenv-win | PYENV_ROOT, PYENV_VERSION | |
| Conda | environment.yml, conda-meta/ | Registries + paths | CONDA_PREFIX, CONDA_DEFAULT_ENV | |
| venv | pyvenv.cfg | In-project | None |
Poetry
Discovery Locations
Virtualenvs cache (default):
- Windows:
%LOCALAPPDATA%\pypoetry\Cache\virtualenvs - macOS:
~/Library/Caches/pypoetry/virtualenvs - Linux:
~/.cache/pypoetry/virtualenvs
In-project (when enabled):
.venv/in project root
Config Precedence (highest to lowest)
- Local config:
poetry.tomlin project root - Environment variables:
POETRY_VIRTUALENVS_* - Global config:
~/.config/pypoetry/config.toml
Known Issues
| Issue | Description | Fix | |
|---|---|---|---|
{cache-dir} placeholder | Not resolved in paths from config | Resolve placeholder before use | |
| Wrong default path | Windows/macOS differ from Linux | Use platform-specific defaults | |
| In-project detection | POETRY_VIRTUALENVS_IN_PROJECT must be checked | Check env var first, then config |
Code Pattern
Pipenv
Discovery Locations
Default:
- Linux:
~/.local/share/virtualenvs/(XDG_DATA_HOME) - macOS:
~/.local/share/virtualenvs/ - Windows:
~\.virtualenvs\
When WORKON_HOME is set:
- Use
$WORKON_HOME/directly
Environment Variables
| Var | Purpose | |
|---|---|---|
WORKON_HOME | Override virtualenv location | |
XDG_DATA_HOME | Base for Linux default | |
PIPENV_VENV_IN_PROJECT | Create .venv/ in project |
Known Issues
| Issue | Description | Fix | |
|---|---|---|---|
| Missing WORKON_HOME support | Env var not checked | Read env var before defaults | |
| Missing XDG_DATA_HOME support | Not used on Linux | Check XDG spec |
Code Pattern
PyEnv
Discovery Locations
Unix:
~/.pyenv/versions/(default)$PYENV_ROOT/versions/(if PYENV_ROOT set)
Windows (pyenv-win):
%USERPROFILE%\.pyenv\pyenv-win\versions\- Different directory structure than Unix!
Key Differences: Unix vs Windows
| Aspect | Unix | Windows (pyenv-win) | |
|---|---|---|---|
| Command | pyenv | pyenv.bat | |
| Root | ~/.pyenv/ | %USERPROFILE%\.pyenv\pyenv-win\ | |
| Shims | ~/.pyenv/shims/ | %USERPROFILE%\.pyenv\pyenv-win\shims\ |
Known Issues
| Issue | Description | Fix | |
|---|---|---|---|
| path.normalize() vs path.resolve() | Windows drive letter missing | Use path.resolve() on both sides | |
| Wrong command on Windows | Looking for pyenv instead of pyenv.bat | Check for .bat extension |
Code Pattern
Conda
Discovery Locations
Environment locations:
- Base install
envs/directory ~/.conda/envs/- Paths in
~/.condarcenvs_dirs
Windows Registry:
HKCU\Software\Python\ContinuumAnalytics\HKLM\SOFTWARE\Python\ContinuumAnalytics\
Shell Activation
| Shell | Activation Command | |
|---|---|---|
| bash, zsh | source activate envname | |
| fish | conda activate envname (NOT source!) | |
| PowerShell | conda activate envname | |
| cmd | activate.bat envname |
Known Issues
| Issue | Description | Fix | |
|---|---|---|---|
| Fish shell activation | Uses bash-style command | Use fish-compatible syntax | |
| Registry paths | May be stale/invalid | Verify paths exist | |
| Base vs named envs | Different activation | Check if activating base |
Code Pattern
venv
Discovery
Identification:
- Look for
pyvenv.cfgfile in directory - Contains
homeand optionallyversionkeys
Version Extraction Priority
versionfield inpyvenv.cfg- Parse from
homepath (e.g.,Python311) - Spawn Python executable (last resort)
Code Pattern
PET Server (Native Finder)
JSON-RPC Communication
The PET server is a Rust-based locator that communicates via JSON-RPC over stdio.
Known Issues
| Issue | Description | Fix | |
|---|---|---|---|
| No timeout | JSON-RPC can hang forever | Add Promise.race with timeout | |
| Silent spawn errors | Extension continues without envs | Surface spawn errors to user | |
| Resource leaks | Worker pool not cleaned up | Dispose on deactivation | |
| Type guard missing | Response types not validated | Add runtime type checks | |
| Cache key collision | Paths normalize to same key | Use consistent normalization |
Code Pattern
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 9 Jul 2026.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/python-manager-discovery/SKILL.md
Popularity
- Repository stars
- 130
- Repository forks
- 49
- 7-day trend score
- 24
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 16 Mar 2026, 8 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/microsoft/vscode-python-environments/python-manager-discovery)