Skip to content

chore: nox error "ModuleNotFoundError: No module named 'pkg_resources'" #381

@smarie

Description

@smarie

setuptools v82 does not include pkg_resources anymore but somehow it is needed somewhere in the wheel building process.

nox > python -m pip install . --no-deps                                                                                                                          
nox > Command python -m pip install . --no-deps failed with exit code 1:
nox > Looking in indexes: https://pypi.org/simple, ...
Processing <path...>\python-pytest-cases
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'error'
  error: subprocess-exited-with-error

  Getting requirements to build wheel did not run successfully.
  exit code: 1

  [20 lines of output]
  Traceback (most recent call last):
    File "<path...>\python-pytest-cases\.nox\tests-3-14-env-pytest-latest\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 389, in <module>
      main()
      ~~~~^^
    File "<path...>\python-pytest-cases\.nox\tests-3-14-env-pytest-latest\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 373, in main
      json_out["return_val"] = hook(**hook_input["kwargs"])
                               ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
    File "<path...>\python-pytest-cases\.nox\tests-3-14-env-pytest-latest\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 143, in get_requires_for_build_wheel
      return hook(config_settings)
    File "<path...>\AppData\Local\Temp\pip-build-env-h6mtcvoi\overlay\Lib\site-packages\setuptools\build_meta.py", line 333, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=[])
             ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "<path...>\AppData\Local\Temp\pip-build-env-h6mtcvoi\overlay\Lib\site-packages\setuptools\build_meta.py", line 301, in _get_build_requires     
      self.run_setup()
      ~~~~~~~~~~~~~~^^
    File "<path...>\AppData\Local\Temp\pip-build-env-h6mtcvoi\overlay\Lib\site-packages\setuptools\build_meta.py", line 317, in run_setup
      exec(code, locals())
      ~~~~^^^^^^^^^^^^^^^^
    File "<string>", line 19, in <module>
  ModuleNotFoundError: No module named 'pkg_resources'
  [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.

[notice] A new release of pip is available: 25.1.1 -> 26.0.1
[notice] To update, run: python.EXE -m pip install --upgrade pip
error: subprocess-exited-with-error

Getting requirements to build wheel did not run successfully.
exit code: 1

See above for output.

One way to fix is to limit the setuptools version. Maybe upgrading pip could also solve this, but I am not certain.

Our build system really needs to be updated...

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