microsoft / microsoft/amplifier

ModuleNotFoundError: No module named 'pygments.lexers.data'

Open
#196 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

Problem

Amplifier execution fails with module import error for pygments.lexers.data:

Error: No module named 'pygments.lexers.data'

Context

  • Environment: uv tool installed amplifier
  • Trigger: Unknown (error reported by user during amplihack testing)
  • Impact: Blocks amplifier execution when pygments lexer is needed

Expected Behavior

Pygments should be properly installed with all required submodules including pygments.lexers.data.

Verification

Local testing shows the module EXISTS in both environments:

# Local Python
$ python3 -c "import pygments.lexers.data; print(pygments.lexers.data.__file__)"
/home/azureuser/.cache/uv/.../pygments/lexers/data.py

# Amplifier UV Tool Environment  
$ /home/azureuser/.local/share/uv/tools/amplifier/bin/python3 -c "import pygments.lexers.data"
/home/azureuser/.local/share/uv/tools/amplifier/lib/python3.12/site-packages/pygments/lexers/data.py

Module exists but error still reported.

Possible Causes

  1. Incomplete pygments installation: Some pygments subpackages missing in certain conditions
  2. Import order issue: Module imported before pygments fully initialized
  3. Version mismatch: Incompatible pygments version
  4. Platform-specific issue: Error only on certain Python versions or platforms

Reproduction

Unable to reproduce consistently. Error occurred during recipe execution but exact trigger unknown.

Recommended Investigation

  1. Add pygments to explicit dependencies with version pin
  2. Add import verification test in CI
  3. Check which amplifier component imports pygments.lexers.data
  4. Verify pygments installation completeness in uv tool environment

Impact

  • Severity: MEDIUM (blocks execution when triggered)
  • Frequency: LOW (inconsistent reproduction)
  • Workaround: Reinstall amplifier or pygments

Related

User reported during amplihack recipe testing. May be related to bundle loading or tool initialization.

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 by identifying which amplifier component imports pygments.lexers.data during recipe execution, then reproduce the failure in the uv tool environment. Compare dependency installation and Pygments versions across the environments described in the issue. Done means the trigger is identified, the installation or import problem is fixed, and an import verification test covers it.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.