# Run2 Robust Env

> Procedures for resolving environment conflicts, broken packages, and restricted system-wide access in Python.

- Skill: `cxcscmu/run2-robust-env` (Agent Skill)
- Install (CLI): `npx get-skill add cxcscmu/run2-robust-env`
- Raw SKILL.md: https://api.skillmd.com/api/skills/cxcscmu/run2-robust-env/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: cxcscmu (https://skillmd.com/u/cxcscmu)
- Updated: 2026-11-24
- Page: https://skillmd.com/skills/cxcscmu/run2-robust-env

---


### Resolving Environment Conflicts
In research environments (e.g., containers), `pip` might face restricted system-wide access or broken distributions.

1. **Handling Externally Managed Environments**:
   If `pip install` fails with "externally-managed-environment", use `--break-system-packages` cautiously or create a virtual environment (`python -m venv`).
   
2. **Fixing Broken Package Distributions**:
   - Symptoms: `OSError: cannot open shared object file` or `WARNING: Ignoring invalid distribution ~orch`.
   - Solution: Uninstall the broken distribution and reinstall.
     ```bash
     pip uninstall <pkg> -y --break-system-packages
     pip install <pkg>==<version> --break-system-packages
     ```

3. **Managing Missing Shared Objects**:
   Always verify the installation of hardware-dependent libraries like `torch` or `flash-attn` by running a basic script to import them.

### Logging System State
Use `python -VV` and `pip freeze` to ensure the runtime state is documented for reproducibility.

