Incorrect Python Interpreter Usage

usabilityActiveRising

The `az.bat` script uses the wrong Python interpreter when installed in a shared directory, leading to command failures.

Opportunity Score (Heuristic (unvalidated)):70 · High · heuristic
First seen: 9/19/2026
Last seen: 9/23/2026

Score Breakdown

Heuristic ranking from public discussion signals — not a validated prediction of commercial opportunity, demand, or willingness to pay.

Composite 70/100 (High, unvalidated). Top driver: Severity (25% weight, 20 pts).

Frequency · 25% · 16.3 pts · XPS relevance65

Heuristic only — often urgency map or random scaffolding on ingest, not measured mention frequency. Maps to XPS relevance (with market size).

Severity · 25% · 20 pts · XPS quality80

LLM/mock judgment of intensity from title/summary text — not ops or ticket data. Maps to XPS quality (with willingness to pay).

Willingness to pay · 30% · 19.5 pts · XPS quality65

LLM/mock purchase-intent guess from text — not invoices, surveys, or paid seats. Maps to XPS quality.

Trend · 10% · 6.8 pts · XPS novelty68

Heuristic/scaffold (often random or fixed on insert) — not a verified mention trajectory. Maps to XPS novelty.

Market size · 10% · 7 pts · XPS relevance70

Heuristic/scaffold (often random or fixed) — not TAM research. Maps to XPS relevance (with frequency).

Catalog notes (not predictive analysis)

Incorrect Python Interpreter Usage (usability). Catalog heuristic opportunity score: 70/100 — a chosen formula over discussion-signal facets, not evidence of demand, conversion, or willingness to pay. Treat as browsing rank, not a commercial prediction.

The `az.bat` script uses the wrong Python interpreter when installed in a shared directory, leading to command failures.

Source Examples

azure/azure-cli Issues·Sep 19, 2026
“{Packaging} `az.bat` silently runs an unrelated Python when the shim is copied outside the environment's Scripts directory (e.g. `uv tool install azure-cli`) ### Describe the bug On Windows, when `azure-cli` is installed from PyPI by a tool that places console shims in a shared `bin` directory (for example `uv tool install azure-cli`), the shipped `az.bat` silently falls back to whatever `python` is first on `PATH` instead of the interpreter of the environment azure-cli was installed into. That interpreter has no `azure` package, so every command fails. The cause is the interpreter probe in `src/azure-cli/az.bat`: ```bat IF EXIST "%~dp0\python.exe" ( "%~dp0\python.exe" -m azure.cli %* ) ELSE ( python -m azure.cli %* ) ``` `az.bat` is declared through setuptools `scripts=` rather than as a `console_scripts` entry point, so installers copy the file verbatim. The probe assumes the copy still sits next to the environment's `python.exe`. Any installer that relocates shims into a shared `bin` directory breaks that assumption, and the `ELSE` branch then executes an unrelated interpreter with no warning. The failure is shell-dependent on Windows, which makes it hard to diagnose. `PATHEXT` causes PowerShell and `cmd` to resolve `az` to the broken `az.bat`, while Git Bash ignores `PATHEXT` and resolves the extensionless `az` script, whose shebang correctly pins the environment's interpreter. The same machine and the same installation therefore succeed in one shell and fail in another. ### Related issues - #21737 reports the identical error from the same `ELSE` branch (an `az.bat` under one Python's `Scripts` directory invoking a different Python from `PATH`). It was closed for inactivity rather than fixed. - #30801 states: "In `src/azure-cli/az` and `src/azure-cli/az.bat`, `src` is added in `PYTHONPATH`. It seems to be a mistake. But these scripts no longer seem to be used." These scripts **are** the entry point for every PyPI installation on Windows, so that assumption does not hold for pip/uv installs. ### Suggested fix 1. Expose `az` as a `console_scripts` entry point. pip and uv both generate a Windows launcher that embeds the absolute path to the environment's interpreter, which removes the probe and makes shim relocation safe. This is the durable fix. 2. Failing that, drop the `ELSE python -m azure.cli %*` fallback, or gate it behind a check that the interpreter can actually import `azure.cli`, and emit a clear error otherwise. Silently running an arbitrary interpreter produces a confusing `ModuleNotFoundError` far from its cause. ### Related command Any command. Reproduced with `az version` and `az --version`; the failure occurs before command dispatch, so it affects every command. ### Errors ``` C:\Users\<user>\AppData\Local\Programs\Python\Python314\python.exe: Error while finding module specification for 'azure.cli' (ModuleNotFoundError: No module named 'azure') ``` ### Issue script & Debug output ```console > uv tool install azure-cli > az version C:\Users\<user>\AppData\Local\Programs\Python\Python314\python.exe: Error while finding module specification for 'azure.cli' (ModuleNotFoundError: No module named 'azure') ``` `--debug` produces no additional output: the failure happens in the `.bat` launcher, before `azure.cli` is imported and before any CLI argument parsing. Behaviour of each launcher present on one machine, using `az --version` to report the bound interpreter: | Launcher | Interpreter used | Result | | --- | --- | --- | | MSI `wbin\az.cmd` | bundled `CLI2\python.exe` (3.14.6) | works | | `<uv tool venv>\Scripts\az.bat` | tool venv `python.exe` (3.14.4, adjacent, probe succeeds) | works | | `~\.local\bin\az` (extensionless, shebang) | tool venv `python.exe` (3.14.4) | works | | `~\.local\bin\az.bat` (shim copied by uv) | bare `python` from `PATH` | **fails** | All four share `~/.azure` as config directory, so the login session is not involved; only the launcher differs. ### Expected behavi”
— aeb-dev↗

Competitive Landscape

  • Existing solutions are either too expensive or too limited
  • Most competitors target enterprise, leaving mid-market underserved
  • Community scripts and manual processes are the primary alternative

Recommended Next Steps

  1. ✓Validate pain intensity with 5-10 target customer interviews
  2. ✓Build minimal viable solution addressing the core workflow
  3. ✓Test pricing with early adopters from community forums

Related Pain Points

Target Customers

  • IT teams at mid-size organizations (100-2000 employees)
  • MSPs and consultants managing multiple client environments
  • Teams without dedicated specialist staff for this domain

Monetization Ideas

  1. 1SaaS subscription model ($99-$499/month depending on scale)
  2. 2Usage-based pricing aligned with value delivered
  3. 3Freemium tier to drive adoption and prove value