pre-commit: importlib-resources is not installed for python<3.7

This line does not install importlib-resources for python<3.7. https://github.com/pre-commit/pre-commit/blob/eecf3472ffa1ce8e8f4638956d319820d80bdf54/setup.py#L50

And this leads to exception ModuleNotFoundError: No module named 'importlib_resources' later when pre-commit runs.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (8 by maintainers)

Most upvoted comments

FWIW, I’m also seeing this issue:

$ python3 --version
Python 3.6.9

$ pip --version
pip 19.3.1 from /usr/local/lib/python3.6/dist-packages/pip (python 3.6)

$ pipenv --version
pipenv, version 2018.11.26

Explicitly requiring importlib-resources in Pipfile resolved the issue for me:

importlib-resources = {version = "*", markers = "python_version < '3.7'"}
$ pipenv install && pipenv shell pre-commit --version
[ ... ]
pre-commit 2.1.0

@asottile Oh great. Thanks for your prompt reply!