Skip to content

[Bug]: No module named setuptools for Python 3.8.10 #2187

Closed

Description

@kaspar-gestalt

Describe the bug

I was trying to install anomalib 1.0.0 from source using pip install . with v1.0.0 checked out. pip list returned setuptools 70.3.0, but I also tried with version 42.0.0 and some version 69.x. I could successfully run python -c 'import setuptools', but when trying pip install ., I got ERROR: No module named 'setuptools'. Then I scrapped my virtual environment created with Python3.8.10 and made a new one with Python3.11, and then all worked fine.

Dataset

Other (please specify in the text field below)

Model

Other (please specify in the field below)

Steps to reproduce the behavior

described above

OS information

OS information:

  • OS: Ubuntu 20.04
  • Python version: 3.8.10
  • Anomalib version: 1.0.0

Expected behavior

pip install . installs anomalib

Screenshots

No response

Pip/GitHub

pip

What version/branch did you use?

24.0

Configuration YAML

none

Logs

pip install .
Processing /anomalib
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
ERROR: Exception:
Traceback (most recent call last):
  File "/.venv/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 179, in exc_logging_wrapper
    status = run_func(*args)
  File "/.venv/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 67, in wrapper
    return func(self, options, args)
  File "/.venv/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 377, in run
    requirement_set = resolver.resolve(
  File "/.venv/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 76, in resolve
    collected = self.factory.collect_root_requirements(root_reqs)
  File "/.venv/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 538, in collect_root_requirements
    reqs = list(
  File "/.venv/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 494, in _make_requirements_from_install_req
    cand = self._make_base_candidate_from_link(
  File "/.venv/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 231, in _make_base_candidate_from_link
    self._link_candidate_cache[link] = LinkCandidate(
  File "/.venv/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 303, in __init__
    super().__init__(
  File "/.venv/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 158, in __init__
    self.dist = self._prepare()
  File "/.venv/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 235, in _prepare
    dist = self._prepare_distribution()
  File "/.venv/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 314, in _prepare_distribution
    return preparer.prepare_linked_requirement(self._ireq, parallel_builds=True)
  File "/.venv/lib/python3.8/site-packages/pip/_internal/operations/prepare.py", line 527, in prepare_linked_requirement
    return self._prepare_linked_requirement(req, parallel_builds)
  File "/.venv/lib/python3.8/site-packages/pip/_internal/operations/prepare.py", line 642, in _prepare_linked_requirement
    dist = _get_prepared_distribution(
  File "/.venv/lib/python3.8/site-packages/pip/_internal/operations/prepare.py", line 72, in _get_prepared_distribution
    abstract_dist.prepare_distribution_metadata(
  File "/.venv/lib/python3.8/site-packages/pip/_internal/distributions/sdist.py", line 56, in prepare_distribution_metadata
    self._install_build_reqs(finder)
  File "/.venv/lib/python3.8/site-packages/pip/_internal/distributions/sdist.py", line 126, in _install_build_reqs
    build_reqs = self._get_build_requires_wheel()
  File "/.venv/lib/python3.8/site-packages/pip/_internal/distributions/sdist.py", line 103, in _get_build_requires_wheel
    return backend.get_requires_for_build_wheel()
  File "/.venv/lib/python3.8/site-packages/pip/_internal/utils/misc.py", line 709, in get_requires_for_build_wheel
    return super().get_requires_for_build_wheel(config_settings=cs)
  File "/.venv/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_impl.py", line 166, in get_requires_for_build_wheel
    return self._call_hook('get_requires_for_build_wheel', {
  File "/.venv/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_impl.py", line 321, in _call_hook
    raise BackendUnavailable(data.get('traceback', ''))
pip._vendor.pyproject_hooks._impl.BackendUnavailable: Traceback (most recent call last):
  File "/.venv/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 77, in _build_backend
    obj = import_module(mod_path)
  File "/.pyenv/versions/3.8.10/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'setuptools'

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. ashwinvaidya17 commented on Jul 15, 2024

    @ashwinvaidya17
    Contributor

    @kaspar-gestalt Anomalib v1.0.0 has 3.10 as the minimum python version (https://github.com/openvinotoolkit/anomalib/blob/v1.0.0/pyproject.toml#L127). I checked out v1.0.0 tag on a new 3.10 and it works fine on it. Note: you need to also use anomalib install after doing pip install . on a fresh environment.

  2. samet-akcay commented on Jul 15, 2024

    @samet-akcay
    Contributor

    Moving to Q&A as this is not a bug but requirement.

  3. locked and limited conversation to collaborators on Jul 15, 2024
  4. converted this issue into a discussion #2191 on Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions