Skip to content

Importlib problems with mpmath #5601

@Masterchef365

Description

@Masterchef365

Summary

Can't import mpmath, throws StopIteration in importlib/metadata/__init__.py.

Expected

Cloned https://github.com/mpmath/mpmath/, and then ran python3 from the root of the repository, import mpmath works as expected.

Actual

Using Rustpython (main, 8484bfa), the same procedure results in:

set value to PackageNotFoundError ignored
Traceback (most recent call last):
  File "/home/duncan/Projects/RustPython/pylib/Lib/importlib/metadata/__init__.py", line 403, in from_name
    return next(cls.discover(name=name))
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/duncan/Downloads/mpmath/mpmath/__init__.py", line 3, in <module>
    __version__ = version(__name__)
  File "/home/duncan/Projects/RustPython/pylib/Lib/importlib/metadata/__init__.py", line 894, in version
    return distribution(distribution_name).version
  File "/home/duncan/Projects/RustPython/pylib/Lib/importlib/metadata/__init__.py", line 867, in distribution
    return Distribution.from_name(distribution_name)
  File "/home/duncan/Projects/RustPython/pylib/Lib/importlib/metadata/__init__.py", line 405, in from_name
    raise PackageNotFoundError(name)
PackageNotFoundError: mpmath

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions