-
-
Notifications
You must be signed in to change notification settings - Fork 587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No module named 'setuptools' when installing through pre-commit #1874
Comments
I also encourage this problem. As workaround, I used the following config: - repo: local
hooks:
- id: isort
name: isort
entry: isort
require_serial: true
language: python
language_version: python3
types_or: [cython, pyi, python]
args: ['--filter-files']
minimum_pre_commit_version: '2.9.2'
additional_dependencies: ['isort==5.10.1'] |
the root cause is a bug in pip coupled with some changes in setuptools -- here's proper workarounds: pre-commit/pre-commit#2178 (comment) |
Thank you for the quick responses everyone! For the readers who get here looking for a solution, I can confirm that all three of the workarounds proposed above work! That is (either of these will do):
|
That pre-commit hook is currently failing to install because of PyCQA/isort#1874, and this change fixes that.
This PR resolves PyCQA/isort#1874, which is currently biting us when we attempt to install the isort pre-commit hook.
Following along on PyCQA/isort#1874 , seems like this is the "real" fix.
This is not an isort specific issue. isort hasn't made any releases that change this behavior, and in fact hasn't made any release in some months. It also has no external dependencies. isort uses poetry intentionally and not setuptools.This breakage is occurring upstream and I encourage you to reach out to the projects responsible, and in the meantime utilize Will keep this issue open and pinned until it is resolved upstream so that users that run into this issue can quickly find appropriate workarounds. |
The underlying issue has been fixed upstream pypa/setuptools@9c9c91c |
We recently (within the past 5 days max) started having our CI pipelines fail due to pre-commit + isort raising a
ModuleNotFoundError: No module named 'setuptools'
. When we comment out the isort hook and leave e.g. black, flake8, etc on, the error goes away.Steps to reproduce (e.g. inside
docker run -it python:3.8 bash
, also tested with 3.8.5, 3.8.12, 3.9):Error details (cat /root/.cache/pre-commit/pre-commit.log)
version information
error information
The text was updated successfully, but these errors were encountered: