# Diagnose Venv Shebang Mismatch

> Diagnose and fix ModuleNotFoundError caused by entry point shebang pointing outside virtual environment

- Skill: `vamseeachanta/diagnose-venv-shebang-mismatch` (Agent Skill)
- Install (CLI): `npx skillmds@latest add vamseeachanta/diagnose-venv-shebang-mismatch`
- Raw SKILL.md: https://api.skillmd.com/api/skills/vamseeachanta/diagnose-venv-shebang-mismatch/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-mismatch

---


# Diagnose Virtual Environment Shebang Mismatch

When a CLI tool throws ModuleNotFoundError for an installed package, check if the entry point shebang (`#!/usr/bin/env python3`) resolves to a different Python than the venv where the package is installed. Verify the installed script location (`which <command>`) against the actual venv path. Update the shebang to explicitly point to the venv's Python binary (`#!/path/to/venv/bin/python3`). Note: reinstalls/updates may revert shebangs to generic defaults — check post-install hooks if this recurs.
