Best practices for managing development environments including Python venv and conda. Always check environment status before installations and confirm with user before proceeding.
npx claudepluginhub joshuarweaver/cascade-ai-ml-engineering --plugin delphine-l-claude-globalThis skill is limited to using the following tools:
Guidelines for working with Python virtual environments (venv) and conda environments. This skill ensures safe, organized package installations by always checking and confirming the active environment before proceeding.
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
Guidelines for working with Python virtual environments (venv) and conda environments. This skill ensures safe, organized package installations by always checking and confirming the active environment before proceeding.
Supporting files in this directory:
installation-patterns.md - Installation commands for venv and conda, channel priority, TOS error handlingbest-practices-and-scenarios.md - Common scenarios, best practices, resumable data fetch patternstroubleshooting-and-examples.md - Troubleshooting common issues and worked examplesActivate this skill whenever:
Before ANY installation command, run these checks:
# Check for active venv
echo "Python executable: $(which python)"
echo "Virtual environment: $VIRTUAL_ENV"
# Check for conda environment
echo "Conda environment: $CONDA_DEFAULT_ENV"
conda info --envs 2>/dev/null || echo "Conda not available"
Scenario A: venv is active
Python executable: /path/to/project/.venv/bin/python
Virtual environment: /path/to/project/.venv
Conda environment:
-> Python venv is active
Scenario B: conda environment is active
Python executable: /path/to/miniconda3/envs/myenv/bin/python
Virtual environment:
Conda environment: myenv
-> Conda environment is active
Scenario C: No environment (system Python)
Python executable: /usr/bin/python
Virtual environment:
Conda environment:
-> No environment active! Warn user.
Scenario D: Both detected (rare)
Virtual environment: /path/to/.venv
Conda environment: base
-> Both active, prioritize what which python shows, but confirm with user
Always ask before proceeding:
I've detected the following environment:
- Environment type: [venv/conda/none]
- Location: [path]
- Python version: [version]
Is this the environment you want me to use for installing [package/tool]?
Wait for user confirmation before proceeding.
For installation commands by environment type, see installation-patterns.md.
If no environment is detected, DO NOT PROCEED with installation. Instead:
WARNING: No Python environment detected!
You're currently using system Python:
- Location: [path to python]
- Version: [version]
Installing packages to system Python can:
- Cause conflicts with system packages
- Require sudo/admin privileges
- Make projects difficult to reproduce
- Break system tools that depend on specific versions
I recommend creating a virtual environment first.
Decision Tree:
Question: What type of project are you working on?
A. Pure Python project (web dev, scripting, etc.)
-> Recommend: Python venv
-> Fast, lightweight, standard Python tool
B. Data science / Scientific computing
-> Ask: Do you need non-Python dependencies? (R, C libraries, etc.)
B1. Yes (or using packages like numpy, scipy, pandas, etc.)
-> Recommend: Conda
-> Better binary dependency management
B2. No, only Python packages
-> Recommend: Python venv
-> Simpler and faster
C. Bioinformatics / Genomics
-> Recommend: Conda (with bioconda channel)
-> Most tools available via bioconda
-> Manages complex dependencies well
D. Galaxy tool development
-> Recommend: Conda
-> Galaxy uses conda for tool dependencies
-> Direct compatibility
For venv:
python -m venv .venv
source .venv/bin/activate # Linux/Mac
which python
For conda:
conda create -n project-name python=3.11
conda activate project-name
conda info --envs
which python
Advantages: Lightweight, fast, built into Python, works on all platforms. Disadvantages: Harder to manage non-Python dependencies, binary packages may need system libraries.
Advantages: Manages binary dependencies, cross-language support, better for scientific packages, can manage Python version. Disadvantages: Slower than venv, larger disk space, requires conda installation.
# Check what's active
which python
echo $VIRTUAL_ENV
echo $CONDA_DEFAULT_ENV
# Python version
python --version
# Installed packages
pip list # for pip
conda list # for conda
# Environment location
pip show package-name # shows where package is installed
# venv
source .venv/bin/activate # Linux/Mac
.venv\Scripts\activate # Windows
# conda
conda activate environment-name
# Deactivation
deactivate # venv
conda deactivate # conda
For common scenarios, best practices, troubleshooting, and worked examples, see the supporting files in this directory.
Always remember:
Never:
This skill ensures clean, reproducible, conflict-free Python environments across all projects.