Skip to content

🐍 Conda & Python Environments

Managing isolated virtual environments and quick package installation is fundamental to scaling AI projects. Your Linux workstation leverages a hybrid of Miniconda3 for environment isolation and uv (by Astral) for ultra-fast dependency operations.


📂 Active Conda Environment Layout

Your Linux system is structured around a unified developer sandbox environment, with options to generate project-specific environments matching the core topics of the curriculum:

  1. base (~/miniconda3)
    The core root installation. Avoid installing general packages here.
  2. ai_dev (~/miniconda3/envs/ai_dev)
    Your primary sandbox for AI agent development, Google Gemini integrations, RAG engineering, and local model inference.
  3. Project-Specific Topic Environments (Optional)
    Custom, isolated environments created for specific architectural workloads:
    • Stateful Orchestration: Spawning dedicated environments for LangGraph state machine development.
    • Observability & Telemetry: Spawning separate environments for Langfuse tracing, pytest regression testing, and local Arize Phoenix servers.

⚡ UV: The Ultra-Fast Dependency Manager

Your environment includes uv, a Rust-based replacement for pip, pip-tools, and virtualenv. uv is 10x to 100x faster than standard pip, featuring aggressive caching and global content-addressable storage.

🚀 Common UV Commands (Linux terminal)

Avoid using raw pip install. Use these custom uv workflows instead:

1. Quick Install a Package

bash
# Installs packages into the active Conda environment instantly
uv pip install google-generativeai langchain-google-genai pandas

2. Install from Requirements File

bash
uv pip install -r requirements.txt

3. Compile a Lockfile (pyproject.toml or requirements.in)

uv can resolve and lock your dependencies in milliseconds:

bash
# Compile and create a locked requirements file
uv pip compile pyproject.toml -o requirements.txt

4. Clean the UV Cache

If you ever run low on disk space:

bash
uv cache clean

🔧 Environment Best Practices

TIP

Always lock your dependencies! Using a locked environment (like uv.lock or requirements.txt generated by uv pip compile) ensures that your agentic architectures don't break when minor packages auto-update.

Creating a New Agent Environment:

To build a clean environment for a new automation or business tool:

bash
# 1. Create the environment with Python 3.11
conda create -n target_agent_env python=3.11 -y

# 2. Activate the environment
conda activate target_agent_env

# 3. Use UV to seed the environment with base packages
uv pip install google-generativeai pydantic fastapi uvicorn