# Diagnose Venv Shebang Conflicts

> Debugging pattern for resolving ModuleNotFoundError when CLI entry points use wrong Python interpreter

- Skill: `vamseeachanta/diagnose-venv-shebang-conflicts` (Agent Skill)
- Install (CLI): `npx skillmds@latest add vamseeachanta/diagnose-venv-shebang-conflicts`
- Raw SKILL.md: https://api.skillmd.com/api/skills/vamseeachanta/diagnose-venv-shebang-conflicts/raw
- Safety review: PASS (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: vamseeachanta (https://skillmd.com/u/vamseeachanta)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/vamseeachanta/diagnose-venv-shebang-conflicts

---


# Diagnose Virtual Environment Shebang Conflicts

When a CLI tool installed via pip fails with ModuleNotFoundError despite packages being installed, check if the entry point shebang points outside the venv. Compare the shebang in `~/.local/bin/<tool>` against the venv's actual python path (`<venv>/bin/python3`). If they differ, the generic `#!/usr/bin/env python3` may resolve to system python lacking venv packages. Update the shebang to point directly to the venv's python, or investigate if package updates are regenerating entry points with incorrect shebangs.
