pytorch-metric-learning: Conda UnsatisfiableError: The following specifications were found to be incompatible with your CUDA driver

Fix the following conda errors (not sure if they are reproducible errors):

Windows:

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versionsThe following specifications were found to be incompatible with your CUDA driver:

  - feature:/win-64::__cuda==10.2=0
  - feature:|@/win-64::__cuda==10.2=0

Your installed CUDA driver is: 10.2

Linux:

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versionsThe following specifications were found to be incompatible with your CUDA driver:

  - feature:/linux-64::__cuda==10.1=0
  - feature:|@/linux-64::__cuda==10.1=0

Your installed CUDA driver is: 10.1

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 32 (13 by maintainers)

Most upvoted comments

I think I finally fixed it, and it was an error in the way I was building the package.

For any other conda-building-noobs out there, here’s what my old meta.yaml looked like:

{% set name = "pytorch-metric-learning" %}
{% set version = "0.9.86" %}

package:
  name: "{{ name|lower }}"
  version: "{{ version }}"

source:
  url: "https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz"
  sha256: "f7327b3314bfccf930c25ea47be78540730106a301ef12fd920a72defadd4247"

build:
  number: 0
  script: "python -m pip install . --no-deps --ignore-installed -vv "

requirements:
  host:
  run:
    - python >=3.0
    - numpy
    - scikit-learn
    - tqdm
    - pytorch
    - torchvision

about:
  home: "https://github.com/KevinMusgrave/pytorch-metric-learning"
  license: "MIT"
  license_family: "MIT"
  license_file: ""
  summary: "The easiest way to use deep metric learning in your application. Modular, flexible, and extensible. Written in PyTorch."
  doc_url: "https://kevinmusgrave.github.io/pytorch-metric-learning"
  dev_url: ""

extra:
  recipe-maintainers:
    - KevinMusgrave

And here’s what my new meta.yaml looks like:

{% set name = "pytorch-metric-learning" %}
{% set version = "0.9.86" %}

package:
  name: "{{ name|lower }}"
  version: "{{ version }}"

source:
  url: "https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz"
  sha256: f7327b3314bfccf930c25ea47be78540730106a301ef12fd920a72defadd4247

build:
  number: 0
  script: "{{ PYTHON }} -m pip install . -vv"
  noarch: python

requirements:
  host:
    - numpy
    - pip
    - python >=3.6
    - scikit-learn
    - pytorch
    - torchvision
    - tqdm
  run:
    - numpy
    - python >=3.6
    - scikit-learn
    - pytorch
    - torchvision
    - tqdm

test:
  imports:
    - pytorch_metric_learning
    - pytorch_metric_learning.losses
    - pytorch_metric_learning.miners
    - pytorch_metric_learning.regularizers
    - pytorch_metric_learning.samplers
    - pytorch_metric_learning.testers
    - pytorch_metric_learning.trainers
    - pytorch_metric_learning.utils

about:
  home: "https://github.com/KevinMusgrave/pytorch-metric-learning"
  license: "MIT"
  license_family: "MIT"
  license_file: ""
  summary: "The easiest way to use deep metric learning in your application. Modular, flexible, and extensible. Written in PyTorch."
  doc_url: "https://kevinmusgrave.github.io/pytorch-metric-learning"
  dev_url: ""

extra:
  recipe-maintainers:
    - KevinMusgrave

The build command that works is: conda-build -c pytorch $pkg, which is what I was doing before. (The new build script can be found here)

The old installation command that failed was: conda install pytorch-metric-learning -c metric-learning

The new command that works is: conda install pytorch-metric-learning -c metric-learning -c pytorch

I have tested this on Linux python 3.7 and 3.8.

Seeing the same error with conda install requests over here. conda-forge works though.

I haven’t gotten around to fixing this. For now, if you want to use this package inside conda, you’ll have to do:

conda install pip
pip install pytorch-metric-learning

@KevinMusgrave Flipping between 3.7 and 3.8 in this environment.yml seems to cause the problem reliably. Moving between variants with conda env update --file ./environment.yml --prune

Went from 3.7 to a fail on 3.8, and back to success on 3.7. Have also tried creating environments from scratch, with apparently identical results. A lot of conda solver computation trying to get to 3.8. environment.zip

I haven’t gotten around to fixing this. For now, if you want to use this package inside conda, you’ll have to do:

conda install pip
pip install pytorch-metric-learning

This worked for me. My environment:

  • Windows10
  • Python 3.9
  • Pytorch 1.10.2
  • No Cuda (CPU version)

Tried installing PyG with pip with command: pip install torch-scatter torch-sparse torch-cluster torch-spline-conv torch-geometric -f https://data.pyg.org/whl/torch-1.10.2+cpu.html

Also tried conda: conda install pyg -c pyg

Kept getting the same error while importing torch-geometric or torch-scatter in Python. Error was:

~\AppData\Local\Temp/ipykernel_11320/2056699366.py in <module>
----> 1 from torch_geometric.data import Data

~\AppData\Local\Continuum\anaconda3\envs\ds\lib\site-packages\torch_geometric\__init__.py in <module>
      2 from importlib import import_module
      3 
----> 4 import torch_geometric.data
      5 import torch_geometric.loader
      6 import torch_geometric.transforms

~\AppData\Local\Continuum\anaconda3\envs\ds\lib\site-packages\torch_geometric\data\__init__.py in <module>
----> 1 from .data import Data
      2 from .hetero_data import HeteroData
      3 from .temporal import TemporalData
      4 from .batch import Batch
      5 from .dataset import Dataset

~\AppData\Local\Continuum\anaconda3\envs\ds\lib\site-packages\torch_geometric\data\data.py in <module>
      7 import torch
      8 from torch import Tensor
----> 9 from torch_sparse import SparseTensor
     10 
     11 from torch_geometric.data.storage import (BaseStorage, EdgeStorage,

~\AppData\Local\Continuum\anaconda3\envs\ds\lib\site-packages\torch_sparse\__init__.py in <module>
     17     spec = cuda_spec or cpu_spec
     18     if spec is not None:
---> 19         torch.ops.load_library(spec.origin)
     20     else:  # pragma: no cover
     21         raise ImportError(f"Could not find module '{library}_cpu' in "

~\AppData\Local\Continuum\anaconda3\envs\ds\lib\site-packages\torch\_ops.py in load_library(self, path)
    108             # static (global) initialization code in order to register custom
    109             # operators with the JIT.
--> 110             ctypes.CDLL(path)
    111         self.loaded_libraries.add(path)
    112 

~\AppData\Local\Continuum\anaconda3\envs\ds\lib\ctypes\__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error, winmode)
    380 
    381         if handle is None:
--> 382             self._handle = _dlopen(self._name, mode)
    383         else:
    384             self._handle = handle

OSError: [WinError 127] The specified procedure could not be found

NOTE: This worked with Pytorch version torch-1.11.0 which was installed by conda

@Hanros94 I just meant that you may need a lower python version (not necessarily 3.7 instead of 3.8).

However it turns out this is exactly the same situation. Your conda repo does not work with python 3.8 but it works with python 3.7 (more precisely 3.7.6), i just tested it:

conda create -n pml376 python=3.7.6
conda activate pml376
conda install pytorch-metric-learning -c metric-learning

Since 3.7.6 is the latest for python 3.7, you could also simply do:

conda create -n pml37 python=3.7
conda activate pml37
conda install pytorch-metric-learning -c metric-learning