Skip to content
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

[Bug]: Anomalib installation with missing dependencies #2449

Open
1 task done
Paucaster3 opened this issue Dec 4, 2024 · 18 comments
Open
1 task done

[Bug]: Anomalib installation with missing dependencies #2449

Paucaster3 opened this issue Dec 4, 2024 · 18 comments

Comments

@Paucaster3
Copy link

Paucaster3 commented Dec 4, 2024

Describe the bug

Description

After installing anomalib with

pip install anomalib

Several dependencies produce ModuleNotFoundError exceptions.

Then, i run the command

anomalib doctor

as suggested in this comment, obtaining the next indications:

anomalib doctor
To use other subcommand using `anomalib install`
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /home/serverai/repo/damages_detection/va-270-damages-detection/venv/bin/anomalib:5 in <module>   │
│                                                                                                  │
│   2 # -*- coding: utf-8 -*-                                                                      │
│   3 import re                                                                                    │
│   4 import sys                                                                                   │
│ ❱ 5 from anomalib.cli.cli import main                                                            │
│   6 if __name__ == '__main__':                                                                   │
│   7 │   sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])                         │
│   8 │   sys.exit(main())                                                                         │
│                                                                                                  │
│ /home/serverai/repo/damages_detection/va-270-damages-detection/venv/lib/python3.11/site-packages │
│ /anomalib/cli/__init__.py:6 in <module>                                                          │
│                                                                                                  │
│   3 # Copyright (C) 2022 Intel Corporation                                                       │
│   4 # SPDX-License-Identifier: Apache-2.0                                                        │
│   5                                                                                              │
│ ❱ 6 from .cli import AnomalibCLI                                                                 │
│   7                                                                                              │
│   8 __all__ = ["AnomalibCLI"]                                                                    │
│   9                                                                                              │
│                                                                                                  │
│ /home/serverai/repo/damages_detection/va-270-damages-detection/venv/lib/python3.11/site-packages │
│ /anomalib/cli/cli.py:18 in <module>                                                              │
│                                                                                                  │
│    15 from rich import traceback                                                                 │
│    16                                                                                            │
│    17 from anomalib import TaskType, __version__                                                 │
│ ❱  18 from anomalib.cli.pipelines import PIPELINE_REGISTRY, pipeline_subcommands, run_pipeline   │
│    19 from anomalib.cli.utils.help_formatter import CustomHelpFormatter, get_short_docstring     │
│    20 from anomalib.cli.utils.openvino import add_openvino_export_arguments                      │
│    21 from anomalib.loggers import configure_logger                                              │
│                                                                                                  │
│ /home/serverai/repo/damages_detection/va-270-damages-detection/venv/lib/python3.11/site-packages │
│ /anomalib/cli/pipelines.py:16 in <module>                                                        │
│                                                                                                  │
│   13 logger = logging.getLogger(__name__)                                                        │
│   14                                                                                             │
│   15 if package_available("anomalib.pipelines"):                                                 │
│ ❱ 16 │   from anomalib.pipelines import Benchmark                                                │
│   17 │   from anomalib.pipelines.components.base import Pipeline                                 │
│   18 │                                                                                           │
│   19 │   PIPELINE_REGISTRY: dict[str, type[Pipeline]] | None = {"benchmark": Benchmark}          │
│                                                                                                  │
│ /home/serverai/repo/damages_detection/va-270-damages-detection/venv/lib/python3.11/site-packages │
│ /anomalib/pipelines/__init__.py:6 in <module>                                                    │
│                                                                                                  │
│   3 # Copyright (C) 2024 Intel Corporation                                                       │
│   4 # SPDX-License-Identifier: Apache-2.0                                                        │
│   5                                                                                              │
│ ❱ 6 from .benchmark import Benchmark                                                             │
│   7                                                                                              │
│   8 __all__ = ["Benchmark"]                                                                      │
│   9                                                                                              │
│                                                                                                  │
│ /home/serverai/repo/damages_detection/va-270-damages-detection/venv/lib/python3.11/site-packages │
│ /anomalib/pipelines/benchmark/__init__.py:6 in <module>                                          │
│                                                                                                  │
│   3 # Copyright (C) 2024 Intel Corporation                                                       │
│   4 # SPDX-License-Identifier: Apache-2.0                                                        │
│   5                                                                                              │
│ ❱ 6 from .pipeline import Benchmark                                                              │
│   7                                                                                              │
│   8 __all__ = ["Benchmark"]                                                                      │
│   9                                                                                              │
│                                                                                                  │
│ /home/serverai/repo/damages_detection/va-270-damages-detection/venv/lib/python3.11/site-packages │
│ /anomalib/pipelines/benchmark/pipeline.py:11 in <module>                                         │
│                                                                                                  │
│    8 from anomalib.pipelines.components.base import Pipeline, Runner                             │
│    9 from anomalib.pipelines.components.runners import ParallelRunner, SerialRunner              │
│   10                                                                                             │
│ ❱ 11 from .generator import BenchmarkJobGenerator                                                │
│   12                                                                                             │
│   13                                                                                             │
│   14 class Benchmark(Pipeline):                                                                  │
│                                                                                                  │
│ /home/serverai/repo/damages_detection/va-270-damages-detection/venv/lib/python3.11/site-packages │
│ /anomalib/pipelines/benchmark/generator.py:9 in <module>                                         │
│                                                                                                  │
│    6 from collections.abc import Generator                                                       │
│    7                                                                                             │
│    8 from anomalib.data import get_datamodule                                                    │
│ ❱  9 from anomalib.models import get_model                                                       │
│   10 from anomalib.pipelines.components import JobGenerator                                      │
│   11 from anomalib.pipelines.components.utils import get_iterator_from_grid_dict                 │
│   12 from anomalib.pipelines.types import PREV_STAGE_RESULT                                      │
│                                                                                                  │
│ /home/serverai/repo/damages_detection/va-270-damages-detection/venv/lib/python3.11/site-packages │
│ /anomalib/models/__init__.py:15 in <module>                                                      │
│                                                                                                  │
│    12 from anomalib.models.components import AnomalyModule                                       │
│    13 from anomalib.utils.path import convert_to_snake_case                                      │
│    14                                                                                            │
│ ❱  15 from .image import (                                                                       │
│    16 │   Cfa,                                                                                   │
│    17 │   Cflow,                                                                                 │
│    18 │   Csflow,                                                                                │
│                                                                                                  │
│ /home/serverai/repo/damages_detection/va-270-damages-detection/venv/lib/python3.11/site-packages │
│ /anomalib/models/image/__init__.py:23 in <module>                                                │
│                                                                                                  │
│   20 from .rkde import Rkde                                                                      │
│   21 from .stfpm import Stfpm                                                                    │
│   22 from .uflow import Uflow                                                                    │
│ ❱ 23 from .vlm_ad import VlmAd                                                                   │
│   24 from .winclip import WinClip                                                                │
│   25                                                                                             │
│   26 __all__ = [                                                                                 │
│                                                                                                  │
│ /home/serverai/repo/damages_detection/va-270-damages-detection/venv/lib/python3.11/site-packages │
│ /anomalib/models/image/vlm_ad/__init__.py:6 in <module>                                          │
│                                                                                                  │
│   3 # Copyright (C) 2024 Intel Corporation                                                       │
│   4 # SPDX-License-Identifier: Apache-2.0                                                        │
│   5                                                                                              │
│ ❱ 6 from .lightning_model import VlmAd                                                           │
│   7                                                                                              │
│   8 __all__ = ["VlmAd"]                                                                          │
│   9                                                                                              │
│                                                                                                  │
│ /home/serverai/repo/damages_detection/va-270-damages-detection/venv/lib/python3.11/site-packages │
│ /anomalib/models/image/vlm_ad/lightning_model.py:14 in <module>                                  │
│                                                                                                  │
│    11 from anomalib import LearningType                                                          │
│    12 from anomalib.models import AnomalyModule                                                  │
│    13                                                                                            │
│ ❱  14 from .backends import Backend, ChatGPT, Huggingface, Ollama                                │
│    15 from .utils import ModelName, Prompt                                                       │
│    16                                                                                            │
│    17 logger = logging.getLogger(__name__)                                                       │
│                                                                                                  │
│ /home/serverai/repo/damages_detection/va-270-damages-detection/venv/lib/python3.11/site-packages │
│ /anomalib/models/image/vlm_ad/backends/__init__.py:7 in <module>                                 │
│                                                                                                  │
│    4 # SPDX-License-Identifier: Apache-2.0                                                       │
│    5                                                                                             │
│    6 from .base import Backend                                                                   │
│ ❱  7 from .chat_gpt import ChatGPT                                                               │
│    8 from .huggingface import Huggingface                                                        │
│    9 from .ollama import Ollama                                                                  │
│   10                                                                                             │
│                                                                                                  │
│ /home/serverai/repo/damages_detection/va-270-damages-detection/venv/lib/python3.11/site-packages │
│ /anomalib/models/image/vlm_ad/backends/chat_gpt.py:12 in <module>                                │
│                                                                                                  │
│     9 from pathlib import Path                                                                   │
│    10 from typing import TYPE_CHECKING                                                           │
│    11                                                                                            │
│ ❱  12 from dotenv import load_dotenv                                                             │
│    13 from lightning_utilities.core.imports import package_available                             │
│    14                                                                                            │
│    15 from anomalib.models.image.vlm_ad.utils import Prompt      

Is there anything I am missing?

Thank you.

Dataset

Other (please specify in the text field below)

Model

PatchCore

Steps to reproduce the behavior

  1. Install anomalib
pip install anomalib
  1. Python code used
from anomalib import TaskType
from anomalib.data import Folder
from anomalib.data.utils import TestSplitMode
from anomalib.models import Patchcore
from anomalib.engine import Engine

datamodule = Folder(
       name=dataset_name,
       normal_dir=selected_normal_path,
       test_split_mode=TestSplitMode.SYNTHETIC,
       task=TaskType.SEGMENTATION,
)

datamodule.setup()

model = Patchcore()
engine = Engine(task=TaskType.SEGMENTATION)

engine.train(datamodule=datamodule, model=model)

OS information

OS information:

  • OS: Ubuntu 20.04
  • Python version: 3.11.10
  • Anomalib version: 1.2.0
  • PyTorch version: 2.5.1

Expected behavior

Anomalib loads all libraries and starts training.

Screenshots

No response

Pip/GitHub

pip

What version/branch did you use?

22.02

Configuration YAML

No configuration YAML

Logs

When running anomalib doctor or anomalib install:

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /home/serverai/repo/damages_detection/va-270-damages-detection/venv/bin/anomalib:5 in <module>   │
│                                                                                                  │
│   2 # -*- coding: utf-8 -*-                                                                      │
│   3 import re                                                                                    │
│   4 import sys                                                                                   │
│ ❱ 5 from anomalib.cli.cli import main                                                            │
│   6 if __name__ == '__main__':                                                                   │
│   7 │   sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])                         │
│   8 │   sys.exit(main())                                                                         │
│                                                                                                  │
│ /home/serverai/repo/damages_detection/va-270-damages-detection/venv/lib/python3.11/site-packages │
│ /anomalib/cli/__init__.py:6 in <module>                                                          │
│                                                                                                  │
│   3 # Copyright (C) 2022 Intel Corporation                                                       │
│   4 # SPDX-License-Identifier: Apache-2.0                                                        │
│   5                                                                                              │
│ ❱ 6 from .cli import AnomalibCLI                                                                 │
│   7                                                                                              │
│   8 __all__ = ["AnomalibCLI"]                                                                    │
│   9                                                                                              │
│                                                                                                  │
│ /home/serverai/repo/damages_detection/va-270-damages-detection/venv/lib/python3.11/site-packages │
│ /anomalib/cli/cli.py:18 in <module>                                                              │
│                                                                                                  │
│    15 from rich import traceback                                                                 │
│    16                                                                                            │
│    17 from anomalib import TaskType, __version__                                                 │
│ ❱  18 from anomalib.cli.pipelines import PIPELINE_REGISTRY, pipeline_subcommands, run_pipeline   │
│    19 from anomalib.cli.utils.help_formatter import CustomHelpFormatter, get_short_docstring     │
│    20 from anomalib.cli.utils.openvino import add_openvino_export_arguments                      │
│    21 from anomalib.loggers import configure_logger                                              │
│                                                                                                  │
│ /home/serverai/repo/damages_detection/va-270-damages-detection/venv/lib/python3.11/site-packages │
│ /anomalib/cli/pipelines.py:16 in <module>                                                        │
│                                                                                                  │
│   13 logger = logging.getLogger(__name__)                                                        │
│   14                                                                                             │
│   15 if package_available("anomalib.pipelines"):                                                 │
│ ❱ 16 │   from anomalib.pipelines import Benchmark                                                │
│   17 │   from anomalib.pipelines.components.base import Pipeline                                 │
│   18 │                                                                                           │
│   19 │   PIPELINE_REGISTRY: dict[str, type[Pipeline]] | None = {"benchmark": Benchmark}          │
│                                                                                                  │
│ /home/serverai/repo/damages_detection/va-270-damages-detection/venv/lib/python3.11/site-packages │
│ /anomalib/pipelines/__init__.py:6 in <module>                                                    │
│                                                                                                  │
│   3 # Copyright (C) 2024 Intel Corporation                                                       │
│   4 # SPDX-License-Identifier: Apache-2.0                                                        │
│   5                                                                                              │
│ ❱ 6 from .benchmark import Benchmark                                                             │
│   7                                                                                              │
│   8 __all__ = ["Benchmark"]                                                                      │
│   9                                                                                              │
│                                                                                                  │
│ /home/serverai/repo/damages_detection/va-270-damages-detection/venv/lib/python3.11/site-packages │
│ /anomalib/pipelines/benchmark/__init__.py:6 in <module>                                          │
│                                                                                                  │
│   3 # Copyright (C) 2024 Intel Corporation                                                       │
│   4 # SPDX-License-Identifier: Apache-2.0                                                        │
│   5                                                                                              │
│ ❱ 6 from .pipeline import Benchmark                                                              │
│   7                                                                                              │
│   8 __all__ = ["Benchmark"]                                                                      │
│   9                                                                                              │
│                                                                                                  │
│ /home/serverai/repo/damages_detection/va-270-damages-detection/venv/lib/python3.11/site-packages │
│ /anomalib/pipelines/benchmark/pipeline.py:11 in <module>                                         │
│                                                                                                  │
│    8 from anomalib.pipelines.components.base import Pipeline, Runner                             │
│    9 from anomalib.pipelines.components.runners import ParallelRunner, SerialRunner              │
│   10                                                                                             │
│ ❱ 11 from .generator import BenchmarkJobGenerator                                                │
│   12                                                                                             │
│   13                                                                                             │
│   14 class Benchmark(Pipeline):                                                                  │
│                                                                                                  │
│ /home/serverai/repo/damages_detection/va-270-damages-detection/venv/lib/python3.11/site-packages │
│ /anomalib/pipelines/benchmark/generator.py:9 in <module>                                         │
│                                                                                                  │
│    6 from collections.abc import Generator                                                       │
│    7                                                                                             │
│    8 from anomalib.data import get_datamodule                                                    │
│ ❱  9 from anomalib.models import get_model                                                       │
│   10 from anomalib.pipelines.components import JobGenerator                                      │
│   11 from anomalib.pipelines.components.utils import get_iterator_from_grid_dict                 │
│   12 from anomalib.pipelines.types import PREV_STAGE_RESULT                                      │
│                                                                                                  │
│ /home/serverai/repo/damages_detection/va-270-damages-detection/venv/lib/python3.11/site-packages │
│ /anomalib/models/__init__.py:15 in <module>                                                      │
│                                                                                                  │
│    12 from anomalib.models.components import AnomalyModule                                       │
│    13 from anomalib.utils.path import convert_to_snake_case                                      │
│    14                                                                                            │
│ ❱  15 from .image import (                                                                       │
│    16 │   Cfa,                                                                                   │
│    17 │   Cflow,                                                                                 │
│    18 │   Csflow,                                                                                │
│                                                                                                  │
│ /home/serverai/repo/damages_detection/va-270-damages-detection/venv/lib/python3.11/site-packages │
│ /anomalib/models/image/__init__.py:23 in <module>                                                │
│                                                                                                  │
│   20 from .rkde import Rkde                                                                      │
│   21 from .stfpm import Stfpm                                                                    │
│   22 from .uflow import Uflow                                                                    │
│ ❱ 23 from .vlm_ad import VlmAd                                                                   │
│   24 from .winclip import WinClip                                                                │
│   25                                                                                             │
│   26 __all__ = [                                                                                 │
│                                                                                                  │
│ /home/serverai/repo/damages_detection/va-270-damages-detection/venv/lib/python3.11/site-packages │
│ /anomalib/models/image/vlm_ad/__init__.py:6 in <module>                                          │
│                                                                                                  │
│   3 # Copyright (C) 2024 Intel Corporation                                                       │
│   4 # SPDX-License-Identifier: Apache-2.0                                                        │
│   5                                                                                              │
│ ❱ 6 from .lightning_model import VlmAd                                                           │
│   7                                                                                              │
│   8 __all__ = ["VlmAd"]                                                                          │
│   9                                                                                              │
│                                                                                                  │
│ /home/serverai/repo/damages_detection/va-270-damages-detection/venv/lib/python3.11/site-packages │
│ /anomalib/models/image/vlm_ad/lightning_model.py:14 in <module>                                  │
│                                                                                                  │
│    11 from anomalib import LearningType                                                          │
│    12 from anomalib.models import AnomalyModule                                                  │
│    13                                                                                            │
│ ❱  14 from .backends import Backend, ChatGPT, Huggingface, Ollama                                │
│    15 from .utils import ModelName, Prompt                                                       │
│    16                                                                                            │
│    17 logger = logging.getLogger(__name__)                                                       │
│                                                                                                  │
│ /home/serverai/repo/damages_detection/va-270-damages-detection/venv/lib/python3.11/site-packages │
│ /anomalib/models/image/vlm_ad/backends/__init__.py:7 in <module>                                 │
│                                                                                                  │
│    4 # SPDX-License-Identifier: Apache-2.0                                                       │
│    5                                                                                             │
│    6 from .base import Backend                                                                   │
│ ❱  7 from .chat_gpt import ChatGPT                                                               │
│    8 from .huggingface import Huggingface                                                        │
│    9 from .ollama import Ollama                                                                  │
│   10                                                                                             │
│                                                                                                  │
│ /home/serverai/repo/damages_detection/va-270-damages-detection/venv/lib/python3.11/site-packages │
│ /anomalib/models/image/vlm_ad/backends/chat_gpt.py:12 in <module>                                │
│                                                                                                  │
│     9 from pathlib import Path                                                                   │
│    10 from typing import TYPE_CHECKING                                                           │
│    11                                                                                            │
│ ❱  12 from dotenv import load_dotenv                                                             │
│    13 from lightning_utilities.core.imports import package_available                             │
│    14                                                                                            │
│    15 from anomalib.models.image.vlm_ad.utils import Prompt                                      │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

When trying to run the script it starts throwing each ModuleNotFoundError.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Paucaster3
Copy link
Author

I ran it also on Windows 11 Pro and gave the same result

@samet-akcay
Copy link
Contributor

@Paucaster3, there is a pr addressing this, but it has not been merged yet

@zhangjy328
Copy link

I ran it on Windows 10,gave ImportError: cannot import name '_encode_image' from 'ollama._client'

@yuzom
Copy link

yuzom commented Dec 8, 2024

Same issue but I am getting:
ModuleNotFoundError: No module named 'lightning'

@samet-akcay
Copy link
Contributor

samet-akcay commented Dec 8, 2024

I ran it on Windows 10,gave ImportError: cannot import name '_encode_image' from 'ollama._client'

You need to install ollama < 0.4, there is an API change that breaks our compatibility.
PR #2456 should address this issue.

@samet-akcay
Copy link
Contributor

Same issue but I am getting: ModuleNotFoundError: No module named 'lightning'

Can you share your installation command so we could reproduce the issue.

@yuzom
Copy link

yuzom commented Dec 8, 2024

Same issue but I am getting: ModuleNotFoundError: No module named 'lightning'

Can you share your installation command so we could reproduce the issue.

Yes here is the installation command:
python3 -m venv venv
source venv/bin/activate
pip install anomalib
anomalib install

@yuzom
Copy link

yuzom commented Dec 8, 2024

It looks like the command anomalib install isn't installing dependencies so I have manually added these libraries:

pip install lightning
pip install torchvision
pip install opencv-python
pip install imgaug

Then, I run into this error:

AttributeError: np.sctypes was removed in the NumPy 2.0 release. Access dtypes explicitly instead.

@TurboJonte
Copy link
Contributor

TurboJonte commented Dec 10, 2024

It looks like the command anomalib install isn't installing dependencies so I have manually added these libraries:

pip install lightning
pip install torchvision
pip install opencv-python
pip install imgaug

Then, I run into this error:

AttributeError: np.sctypes was removed in the NumPy 2.0 release. Access dtypes explicitly instead.

I'm also having issues installing Anomalib 1.2.0 using pip.
A lot of dependencies needed to be installed manually.
I downgraded Numpy to to 1.26.4 using pip install numpy==1.26.4 and got a couple of steps further, eventually failing at installing the "dotenv" module.
I also tried with the command pip install --use-pep517 mentioned in the error but with no luck.

  Using cached dotenv-0.0.5.tar.gz (2.4 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [78 lines of output]
      C:\ProgramData\Anaconda3\envs\anomalib_env_1_2_0\lib\site-packages\setuptools\__init__.py:94: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
      !!

              ********************************************************************************
              Requirements should be satisfied by a PEP 517 installer.
              If you are using pip, you can try "pip install --use-pep517".
              ********************************************************************************

      !!
        dist.fetch_build_eggs(dist.setup_requires)
        error: subprocess-exited-with-error

        python setup.py egg_info did not run successfully.
        exit code: 1

        [16 lines of output]
        Traceback (most recent call last):
          File "<string>", line 2, in <module>
          File "<pip-setuptools-caller>", line 14, in <module>
          File "C:\Users\vision\AppData\Local\Temp\pip-wheel-q4netdft\distribute_8ee22f5aff9e42909196567cac32f99b\setuptools\__init__.py", line 2, in <module>
            from setuptools.extension import Extension, Library
          File "C:\Users\vision\AppData\Local\Temp\pip-wheel-q4netdft\distribute_8ee22f5aff9e42909196567cac32f99b\setuptools\extension.py", line 5, in <module>
            from setuptools.dist import _get_unpatched
          File "C:\Users\vision\AppData\Local\Temp\pip-wheel-q4netdft\distribute_8ee22f5aff9e42909196567cac32f99b\setuptools\dist.py", line 7, in <module>
            from setuptools.command.install import install
          File "C:\Users\vision\AppData\Local\Temp\pip-wheel-q4netdft\distribute_8ee22f5aff9e42909196567cac32f99b\setuptools\command\__init__.py", line 8, in <module>
            from setuptools.command import install_scripts
          File "C:\Users\vision\AppData\Local\Temp\pip-wheel-q4netdft\distribute_8ee22f5aff9e42909196567cac32f99b\setuptools\command\install_scripts.py", line 3, in <module>
            from pkg_resources import Distribution, PathMetadata, ensure_directory
          File "C:\Users\vision\AppData\Local\Temp\pip-wheel-q4netdft\distribute_8ee22f5aff9e42909196567cac32f99b\pkg_resources.py", line 1518, in <module>
            register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
        AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
        [end of output]

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

      Encountered error while generating package metadata.

      See above for output.

      note: This is an issue with the package mentioned above, not pip.
      hint: See above for details.
      Traceback (most recent call last):
        File "C:\ProgramData\Anaconda3\envs\anomalib_env_1_2_0\lib\site-packages\setuptools\installer.py", line 102, in _fetch_build_egg_no_warn
          subprocess.check_call(cmd)
        File "C:\ProgramData\Anaconda3\envs\anomalib_env_1_2_0\lib\subprocess.py", line 369, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['C:\\ProgramData\\Anaconda3\\envs\\anomalib_env_1_2_0\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\\Users\\vision\\AppData\\Local\\Temp\\tmp37u6ulx5', '--quiet', 'distribute']' returned non-zero exit status 1.

      The above exception was the direct cause of the following exception:

      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\vision\AppData\Local\Temp\pip-install-v25_zb_y\dotenv_0da132da04b6462397018de35ebd5c2f\setup.py", line 13, in <module>
          setup(name='dotenv',
        File "C:\ProgramData\Anaconda3\envs\anomalib_env_1_2_0\lib\site-packages\setuptools\__init__.py", line 116, in setup
          _install_setup_requires(attrs)
        File "C:\ProgramData\Anaconda3\envs\anomalib_env_1_2_0\lib\site-packages\setuptools\__init__.py", line 89, in _install_setup_requires
          _fetch_build_eggs(dist)
        File "C:\ProgramData\Anaconda3\envs\anomalib_env_1_2_0\lib\site-packages\setuptools\__init__.py", line 94, in _fetch_build_eggs
          dist.fetch_build_eggs(dist.setup_requires)
        File "C:\ProgramData\Anaconda3\envs\anomalib_env_1_2_0\lib\site-packages\setuptools\dist.py", line 617, in fetch_build_eggs
          return _fetch_build_eggs(self, requires)
        File "C:\ProgramData\Anaconda3\envs\anomalib_env_1_2_0\lib\site-packages\setuptools\installer.py", line 39, in _fetch_build_eggs
          resolved_dists = pkg_resources.working_set.resolve(
        File "C:\ProgramData\Anaconda3\envs\anomalib_env_1_2_0\lib\site-packages\pkg_resources\__init__.py", line 897, in resolve
          dist = self._resolve_dist(
        File "C:\ProgramData\Anaconda3\envs\anomalib_env_1_2_0\lib\site-packages\pkg_resources\__init__.py", line 933, in _resolve_dist
          dist = best[req.key] = env.best_match(
        File "C:\ProgramData\Anaconda3\envs\anomalib_env_1_2_0\lib\site-packages\pkg_resources\__init__.py", line 1271, in best_match
          return self.obtain(req, installer)
        File "C:\ProgramData\Anaconda3\envs\anomalib_env_1_2_0\lib\site-packages\pkg_resources\__init__.py", line 1307, in obtain
          return installer(requirement) if installer else None
        File "C:\ProgramData\Anaconda3\envs\anomalib_env_1_2_0\lib\site-packages\setuptools\installer.py", line 104, in _fetch_build_egg_no_warn
          raise DistutilsError(str(e)) from e
      distutils.errors.DistutilsError: Command '['C:\\ProgramData\\Anaconda3\\envs\\anomalib_env_1_2_0\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\\Users\\vision\\AppData\\Local\\Temp\\tmp37u6ulx5', '--quiet', 'distribute']' returned non-zero exit status 1.
      [end of output]

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

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.```

@samet-akcay
Copy link
Contributor

yeah, looks like it is broken. We were working on the v2 release, so did not prioritise this one much. we'd better fix this one as well

@TurboJonte
Copy link
Contributor

yeah, looks like it is broken. We were working on the v2 release, so did not prioritise this one much. we'd better fix this one as well

I eventually found out that the module name was wrong, it should be pip install python-dotenv

@alexriedel1
Copy link
Contributor

yeah, looks like it is broken. We were working on the v2 release, so did not prioritise this one much. we'd better fix this one as well

The problem is in imgaug that uses the now missing numpy functions. aleju/imgaug#859
However imgaug is badly maintained as this is known since october and the pr to fix this is not merged

@samet-akcay
Copy link
Contributor

@alexriedel1, I've removed imgaug in v2, but it introduces some breaking changes and a new API. That's why I was not able to mirror the fix on the main yet

@samet-akcay
Copy link
Contributor

Here in this PR #2436, I replaced the imgaug related stuff with torchvision transforms

@yuzom
Copy link

yuzom commented Dec 17, 2024

yeah, looks like it is broken. We were working on the v2 release, so did not prioritise this one much. we'd better fix this one as well

Should we wait until v2, wait for the fix on v1, or try to patch the installation ourselves? If anybody has a successful workaround, I would love to hear.

@samet-akcay
Copy link
Contributor

Did you have a chance to try this on v2 branch? If yes, was the issue there?
v2 will be released to PyPI this week.

@yuzom
Copy link

yuzom commented Dec 18, 2024

I have tried this and it seems to work:

pip install git+https://github.com/openvinotoolkit/anomalib.git@release/v2.0.0
anomalib install

However this has broken the example code I have been trying out the library on.

@sebcactus
Copy link

Hi, for the 1.2.0 version this worked for me:
pip install anomalib[full] "ollama<0.4"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants