python-environment
Skill1 starsChanged 3 months agoMITView on GitHub
Virtual environment creation, Python version pinning, and environment reproducibility using uv, venv, or Conda without global package pollution.
- Installs packages
In this repository30 other files it gives its agents.
- AGENTS.mdAGENTS.md
- adr-managementSkill
- agentic-developmentSkill
- ci-cdSkill
- code-architectureSkill
- database-postgresqlSkill
- data-engineeringSkill
- debuggingSkill
- deep-learningSkill
- dependency-managementSkill
- deploymentSkill
- dockerSkill
- documentation-orchestratorSkill
- documentationSkill
- environment-guardrailsSkill
- frontend-react-typescriptSkill
- git-githubSkill
- machine-learningSkill
- observabilitySkill
- performance-optimizationSkill
- portfolio-readinessSkill
- project-bootstrapSkill
- project-knowledgeSkill
- python-apiSkill
- rag-ocr-llmSkill
- release-engineeringSkill
- reusable-componentsSkill
- security-secretsSkill
- supply-chain-securitySkill
- testing-qualitySkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 3 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Use this skill when:
- Very specific: line 16
Do NOT use this skill for general package dependency upgrades (use dependency-management).
- Very specific: line 22
Active Python Interpreter: Run python --version and which python / where python.
- Very specific: line 24
Look for .venv/, venv/, .python-version, pyproject.toml, uv.lock, requirements.txt, Pipfile, environment.yml.
- Very specific: line 108
NEVER install packages globally: Never run pip install <package> without an active virtual environment.
- Very specific: line 109
NEVER commit
.venv/to Git: Always ensure .venv/ and venv/ are present in .gitignore. - Distinctive: line 110
NEVER hardcode machine-specific paths: Avoid relying on absolute user home paths in scripts or configurations.
- Very specific: line 111
NEVER force-migrate a working project: Do not delete existing conda or poetry configurations to force uv without explicit user intent.
- Distinctive: line 117
Run these verification commands to ensure complete isolation:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Python Environment Skill
1. When Should I Use This?
Use this skill when:
- Creating, configuring, or repairing a Python virtual environment.
- Choosing between
uv,venv, andcondafor a new or existing project. - Verifying Python runtime compatibility and lockfile state.
- Resolving environment isolation failures or "command not found" interpreter issues.
Do NOT use this skill for general package dependency upgrades (use dependency-management).
2. What Should I Inspect First?
- Active Python Interpreter: Run
python --versionandwhich python/where python. - Existing Environment Markers:
- Look for
.venv/,venv/,.python-version,pyproject.toml,uv.lock,requirements.txt,Pipfile,environment.yml.
- Look for
- Environment Manager: Detect whether the project already uses
uv,poetry,conda, or standardvenv. - Platform & Architecture: Windows vs Linux/macOS, architecture (
x86_64vsarm64), and CUDA availability (nvidia-smiortorch.cuda.is_available()).
3. What Workflow Should I Follow?
Inspect Existing Environment Artifacts
↓
Is this a new project or already using uv?
├── YES → Modern uv Workflow (uv venv, uv pip / uv sync)
└── NO → Respect Existing Toolchain (venv, conda, pip)
↓
Pin Python Version (.python-version / pyproject.toml)
↓
Create Isolated Virtual Environment in .venv/
↓
Verify Interpreter Path & IsolationModern Standard Workflow (uv)
# 1. Pin Python version
echo "3.12" > .python-version
# 2. Create isolated virtual environment
uv venv .venv --python 3.12
# 3. Synchronize / Install dependencies deterministically
uv sync
# 4. Execute commands directly inside .venv (Universal Cross-Platform: No activation needed!)
uv run python app/main.py
uv run pytest -v
# (Optional) Manual shell activation if desired:
# Windows (PowerShell): .\.venv\Scripts\Activate.ps1
# Linux / macOS: source .venv/bin/activateFallback Workflow A: Standard Python venv
# 1. Create venv
python -m venv .venv
# 2. Upgrade pip inside venv
.venv/Scripts/python -m pip install --upgrade pip setuptools wheel
# 3. Install requirements
.venv/Scripts/python -m pip install -r requirements.txtFallback Workflow B: Conda (for specialized CUDA / legacy C-extensions)
# 1. Create conda env
conda create -n my-project-env python=3.11 -y
# 2. Activate conda env
conda activate my-project-env
# 3. Install dependencies
pip install -r requirements.txt4. What Decisions Should I Make?
| Project Scenario | Recommended Environment Tool | Rationale |
| New Python Project | uv (.venv/ + uv.lock) | 10-100x faster resolution, strict lockfile reproducibility, native multi-Python management. |
Existing pyproject.toml / requirements.txt | Maintain existing tool (uv or venv) | Avoid gratuitous churn unless requested by user. |
| GPU / DICOM / C++ extensions (e.g. MedVision/CUDA) | Virtualenv with pinned wheels or Conda | Ensures binary wheel compatibility with host CUDA drivers. |
| Docker Container | uv pip install --system or slim python -m venv | Reduces image layer size and runtime overhead. |
5. What Should I Avoid?
- NEVER install packages globally: Never run
pip install <package>without an active virtual environment. - NEVER commit
.venv/to Git: Always ensure.venv/andvenv/are present in.gitignore. - NEVER hardcode machine-specific paths: Avoid relying on absolute user home paths in scripts or configurations.
- NEVER force-migrate a working project: Do not delete existing
condaorpoetryconfigurations to forceuvwithout explicit user intent.
6. How Should I Verify Success?
Run these verification commands to ensure complete isolation:
# 1. Confirm python points to the local virtual environment
python -c "import sys; print(sys.executable); assert '.venv' in sys.executable or 'my-project-env' in sys.executable, 'Global Python detected!'"
# 2. Confirm site-packages location is local
python -c "import site; print(site.getsitepackages())"
# 3. Verify core imports succeed
python -c "import pytest, ruff; print('Environment tooling verified')"Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

