Skip to content

ModuleNotFoundError: No module named 'pycparser.plyparser' #99

@sdbbs

Description

@sdbbs

I am using pycparserext in MSYS2/MINGW64, which I updated a couple of days ago, and got Python 3.14 installed; and I got my mingw-w64-x86_64-python-pycparser package updated to 3.0-2. Since pycparserext is not in the MSYS2 package repository, I installed it with python3 -m pip install pycparserext --no-deps --break-system-packages, so now my state is:

$ python3 -c 'import pycparser; import pycparserext; import importlib.metadata; pversion = importlib.metadata.version("pycparserext"); print(f"{pycparser.__version__=} {pversion=}")'
pycparser.__version__='3.00' pversion='2024.1'

This combination however, fails in my script that used to work:

Traceback (most recent call last):
  File "C:/tmp/mytest.py", line 34, in <module>
    import pycparserext.ext_c_generator
  File "C:/msys64/mingw64/lib/python3.14/site-packages/pycparserext/ext_c_generator.py", line 4, in <module>
    from pycparserext.ext_c_parser import FuncDeclExt, TypeDeclExt
  File "C:/msys64/mingw64/lib/python3.14/site-packages/pycparserext/ext_c_parser.py", line 10, in <module>
    from pycparser.plyparser import parameterized, template
ModuleNotFoundError: No module named 'pycparser.plyparser'

The problem is that, as noted in PSA: Please try the new pycparser 3.00 release · Issue #592 · eliben/pycparser:

This release includes a major refactoring (removing the PLY dependency), which should cause no functional change - the emitted AST is identical and the giant test suite keeps passing.

... however, it removed pycparser.plyparser too, which makes pycparserext fail now.

Not sure how that can be fixed - I've tried to find examples of how should previous use of @parameterized decorator be changed, but I could not ...

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