Skip to content
Back to skills

Diagnose Shebang Venv Import Errors

ASecurity

Troubleshoot ModuleNotFoundError in CLI tools by identifying shebang-venv mismatches

  • 17 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 9, 2026
code-qualitypythondebugging

Works with

  • cli

Security analysis

A100/100

Scanned September 9, 2026

npx -y skills add vamseeachanta/workspace-hub --skill diagnose-shebang-venv-import-errors --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Diagnose Shebang Venv Import Errors?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Diagnose Shebang Venv Import Errors
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vamseeachanta-diagnose-shebang-venv-import-errors/badge)](https://www.skillsdirectory.com/skills/vamseeachanta-diagnose-shebang-venv-import-errors)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: diagnose-shebang-venv-import-errors
description: Troubleshoot ModuleNotFoundError in CLI tools by identifying shebang-venv mismatches
version: 1.0.0
source: auto-extracted
extracted: 2026-04-10
metadata:
  tags: ["python", "venv", "debugging", "cli-tools"]
---

# Diagnose Shebang vs Virtual Environment Import Errors

When a CLI tool fails with ModuleNotFoundError despite the package being installed, check if the shebang in `/usr/local/bin/` or `~/.local/bin/` points to system Python instead of the venv Python. Verify the actual Python interpreter being used by examining the shebang (`#!/usr/bin/env python3` vs `/path/to/venv/bin/python3`). If mismatched, update the shebang to explicitly point to the venv's Python executable. Be aware that auto-update mechanisms may revert custom shebangs—check for post-install scripts that regenerate entry points.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.