agentleFS
flonatflonat/flonat-research/skills/python-env/SKILL.md

python-env

Skill150 starsChanged 9 days agoMITView on GitHub

Create and maintain Python environments and dependencies with uv. Use when installing packages, creating a virtual environment, resolving Python dependency state, or migrating away from pip. Not for general Python coding.

  • Installs packages

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

Python Environment Management

CRITICAL RULE: Never use pip directly. Always use uv. This applies to all Python package management.

Golden Rule

ALWAYS use uv for Python package and environment management. Never use pip directly.

Commands

TaskCommand
Create venvuv venv
Install packageuv pip install <package>
Install from requirementsuv pip install -r requirements.txt
Run script in projectuv run python script.py
Run with dependenciesuv run --with pandas python script.py
Install CLI tool globallyuv tool install <tool>
Sync project depsuv sync
Add dependencyuv add <package>

Project Setup

For new projects:

uv init
uv add <dependencies>
uv sync

For existing projects with pyproject.toml:

uv sync
uv run python main.py

Rules

  1. Never use pip install — always uv pip install or uv add
  2. Never install globally — use uv tool install for CLI tools
  3. Always work in a venv — created by uv venv or uv sync
  4. Use uv run — to execute scripts within the project environment

Typical Project

For a project with a Python entry point:

cd <project>
uv sync                           # Install dependencies
uv run python scripts/task.py     # Run a project script

On [HPC cluster] HPC

[HPC cluster] uses Miniconda3 + Lmod (not uv) because cluster users need to compose with module load CUDA/12.6.0 and other pre-built modules. The project-specific pattern is hpc/env-setup.sh (conda create + pip install) — see docs/guides/hpc.md and reference implementations under Projects/NLP/{example-project-a,example-project-b}/hpc/env-setup.sh. The local dev env still uses uv; HPC gets its own conda env with identical pins. Don't try to port uv to [HPC cluster] — the module system assumes conda.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.