microsoft / microsoft/amplifier

feat: module validation errors should include install hint when dependency is missing

Open
#227 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
3.1k
Forks
261
Avg merge
3h 28m
Merged PRs (30d)
13

Description

Summary

When a module fails the module_importable validation check due to a missing Python dependency, the error message only states the missing module name. It should also provide the exact command the user needs to run to resolve it.

Current behavior

Failed to load module 'tool-media-pipeline': Module 'tool-media-pipeline' failed validation: 
FAILED: 0/1 checks passed (1 errors, 0 warnings). 
Errors: module_importable: Failed to import module: No module named 'edge_tts'

The user must then figure out on their own:

  1. That edge_tts maps to the PyPI package edge-tts (different spelling)
  2. That Amplifier is installed via uv tool and cannot use a plain pip install
  3. The correct fix: uv tool install --with edge-tts amplifier

Desired behavior

The validation error should include a human-readable install hint:

Failed to load module 'tool-media-pipeline': missing dependency 'edge_tts'
Fix: uv tool install --with edge-tts amplifier

Broader opportunity

Modules already know what they import. If modules could optionally declare a pypi_package mapping alongside their imports (e.g. edge_tts -> edge-tts), the loader could:

  1. Detect the missing import
  2. Look up the correct PyPI package name
  3. Surface the exact uv tool install --with <package> amplifier command in the error

This would close the UX gap for any module with optional dependencies — TTS providers, OCR libraries, cloud SDKs, etc. — without requiring auto-installation (which carries security implications).

Context

  • Amplifier is installed as a uv isolated tool, so pip install doesn't work
  • Auto-install at runtime would have security implications and is not requested here
  • The ask is purely better error messaging + optional dependency declaration so the loader can generate the right hint

Affected module

tool-media-pipeline (requires edge-tts, which is not bundled by default)

Labels

enhancement, dx, module-loader

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the module_importable validation check and the tool-media-pipeline module, then trace how missing Python imports are reported and how modules declare dependencies. Define the optional import-to-PyPI mapping and verify that a missing edge_tts dependency produces the requested uv tool install hint without auto-installing packages.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.