python-env
npx machina-cli add skill aiskillstore/marketplace/python-env --openclawPython Environment
Fast Python environment management with uv.
Quick Commands
| Task | Command |
|---|---|
| Create venv | uv venv |
| Install package | uv pip install requests |
| Install from requirements | uv pip install -r requirements.txt |
| Run script | uv run python script.py |
| Show installed | uv pip list |
Virtual Environment
# Create venv (instant)
uv venv
# Create with specific Python
uv venv --python 3.11
# Activate (or use uv run)
source .venv/bin/activate # Unix
.venv\Scripts\activate # Windows
Package Installation
# Single package
uv pip install requests
# Multiple packages
uv pip install flask sqlalchemy pytest
# With extras
uv pip install "fastapi[all]"
# Version constraints
uv pip install "django>=4.0,<5.0"
# Uninstall
uv pip uninstall requests
Minimal pyproject.toml
[project]
name = "my-project"
version = "0.1.0"
requires-python = ">=3.10"
dependencies = [
"httpx>=0.25",
"pydantic>=2.0",
]
[project.optional-dependencies]
dev = [
"pytest>=7.0",
"ruff>=0.1",
]
Project Setup Checklist
mkdir my-project && cd my-project
uv venv
# Create pyproject.toml
uv pip install -e ".[dev]"
uv pip list
Troubleshooting
| Issue | Solution |
|---|---|
| "No Python found" | uv python install 3.11 |
| Wrong Python version | uv venv --python 3.11 |
| Conflicting deps | uv pip compile --resolver=backtracking |
| Cache issues | uv cache clean |
When to Use
- Always use uv over pip for speed
- Creating virtual environments
- Installing packages
- Managing dependencies
- Running scripts in project context
Additional Resources
For detailed patterns, load:
./references/pyproject-patterns.md- Full pyproject.toml examples, tool configs./references/dependency-management.md- Lock files, workspaces, private packages./references/publishing.md- PyPI publishing, versioning, CI/CD
See Also
This is a foundation skill with no prerequisites.
Build on this skill:
python-typing-patterns- Type hints for projectspython-pytest-patterns- Testing infrastructurepython-fastapi-patterns- Web API development
Source
git clone https://github.com/aiskillstore/marketplace/blob/main/skills/0xdarkmatter/python-env/SKILL.mdView on GitHub Overview
Python-env is a fast environment manager powered by the uv CLI. It streamlines creating virtual environments, installing packages, and managing dependencies with blazing speed - 10-100x faster than pip. It responds to triggers like uv, venv, pip, pyproject, Python environment, install package, and dependencies.
How This Skill Works
The uv CLI handles venv creation (uv venv), package installation (uv pip install ...), and script execution (uv run ...). It can show installed packages with uv pip list. All actions route through standard Python tooling, but uv orchestrates the workflow for speed and consistency across projects.
When to Use It
- Create a project-specific virtual environment quickly
- Install dependencies from pyproject or requirements.txt
- Install and manage packages with fast, consistent commands
- Run scripts in the project context without manual env activation
- Troubleshoot or adjust Python versions inside a controlled env
Quick Start
- Step 1: Install uv CLI: curl -LsSf https://astral.sh/uv/install.sh | sh
- Step 2: Create a venv: uv venv
- Step 3: Install dependencies: uv pip install -r requirements.txt
Best Practices
- Always use uv over pip for speed
- Create a dedicated venv per project with uv venv
- Install dev dependencies with uv pip install -e .[dev] when using a pyproject.toml
- Keep pyproject.toml dependencies in sync for reproducible installs
- If you hit conflicts, try uv pip compile --resolver=backtracking and uv cache clean
Example Use Cases
- Create a venv for a new project: uv venv
- Install a single package: uv pip install requests
- Install from requirements: uv pip install -r requirements.txt
- Run a script in project context: uv run python script.py
- List installed packages: uv pip list