Skip to content

PyPI wheel missing json_prob_parser module - ModuleNotFoundError on import #3

@jawond

Description

@jawond

Description

The agentjson PyPI package (version 0.1.2) has a packaging bug where the json_prob_parser module is not included in the wheel distribution.

Expected Behavior

The high-level API should work:

from agentjson import parse
result = parse('{"key": "value",}')  # trailing comma

Actual Behavior

Import fails with ModuleNotFoundError:

>>> from agentjson import parse
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".../agentjson/__init__.py", line 1, in <module>
    from .json_prob_parser import parse
ModuleNotFoundError: No module named 'agentjson.json_prob_parser'

Workaround

The low-level Rust API still works:

from agentjson.agentjson_rust import parse_py
result = parse_py('{"key": "value",}')

Environment

  • Package version: 0.1.2
  • Installation: pip install agentjson
  • Python: 3.11
  • Platform: macOS (arm64)

Likely Cause

The json_prob_parser.py file (or compiled equivalent) appears to be missing from the wheel distribution. This may be a pyproject.toml or MANIFEST.in issue where the Python wrapper module is not being included in the built package.

Suggested Fix

Check the packaging configuration to ensure json_prob_parser is included in the wheel. This might require updating the [tool.maturin] or [tool.setuptools] section of pyproject.toml.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions