Pytest: ModuleNotFoundError: No module named 'importlib_metadata'

Created on 23 Apr 2020  Â·  4Comments  Â·  Source: pytest-dev/pytest

I'm trying to test my plugin w/ various Python versions and the latest pytest works on Python 3.8 only. Python 3.7 and 3.6 failed with the $subj message.

The problem gone if I install importlib_metadata package "manually".

invalid question

Most helpful comment

For people suffering this with pipenv, search into your .lock file if ther's an importlib-metadata entrance... If you don't find it, then regenerate your .lock file again and it will be there and this will be fixed.

All 4 comments

The importlib_metadata package is a dependency of pytest for Python < 3.8:

https://github.com/pytest-dev/pytest/blob/7d5f5a878598aaa7f3e100ef6a97bcd13c1b408d/setup.py#L14

pytest is expected to be installed through pip or another program which takes care to install such dependencies. If you are using another installation method, take a look at list from the link above and make sure all of the dependencies are satisfied.

I use pipenv which is supposed to be a sane install method...

For people suffering this with pipenv, search into your .lock file if ther's an importlib-metadata entrance... If you don't find it, then regenerate your .lock file again and it will be there and this will be fixed.

Yeah, somehow the problem is gone %)
Case closed.

On Wed, Jun 10, 2020 at 4:14 PM DjMoren notifications@github.com wrote:

For people suffering this with pipenv, search into your .lock file if
ther's an importlib-metadata entrance... If you don't find it, then
regenerate your .lock file again and it will be there and this will be
fixed.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/pytest-dev/pytest/issues/7114#issuecomment-641822774,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAEF62YIFDKZ24EQDJ2ER43RV46IHANCNFSM4MPGSL7Q
.

Was this page helpful?
0 / 5 - 0 ratings