Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Conda-Build: Unsatisfiable dependencies for platform osx-64: {"torch[version='>=0.4']"}

I'm new to building conda package. I've uploaded the package to PyPI, so I followed this documentation about building conda from pip package. It works when I tried building pyinstrument from pip, but I got the following error when I tried building my package.

conda_build.exceptions.DependencyNeedsBuildingError: Unsatisfiable dependencies for platform osx-64: {"torch[version='>=0.4']"}

I found a similar issue here, but adding channel didn't fix my issue since pytorch exists in default channel.

Here is my meta.yml file:

{% set name = "scvi" %}
{% set version = "0.1.2" %}
{% set file_ext = "tar.gz" %}
{% set hash_type = "sha256" %}
{% set hash_value = "ca87155662d85605f86c5e86b7b9f64d881b882177b9642fff8f0ea215c6cb1a" %}

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

source:
  fn: '{{ name }}-{{ version }}.{{ file_ext }}'
  url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.{{ file_ext }}
  '{{ hash_type }}': '{{ hash_value }}'

build:
  number: 0
  script: python setup.py install --single-version-externally-managed --record=record.txt

requirements:
  run:
    - python 3.6
    - setuptools
    - numpy>=1.0
    - torch>=0.4
    - matplotlib>=2.0
    - scikit-learn>=0.18
    - scipy>=1.0
    - h5py>=2.8
    - pandas>=0.2
    - loompy>=2.0

test:
  imports:
    - scvi
    - scvi.dataset
    - scvi.metrics
    - scvi.models
  requires:
    - pytest

about:
  home: https://github.com/YosefLab/scVI
  license: MIT
  license_family: MIT
  license_file: 'LICENSE'
  summary: Single-cell Variational Inference
  description: Single-cell Variational Inference
  doc_url: https://scvi.readthedocs.io
  dev_url: https://github.com/YosefLab/scVI

Any possible solutions or suggestions on which direction I should look into would be very helpful. Thanks!

like image 404
Yining.L Avatar asked Jun 15 '18 21:06

Yining.L


1 Answers

Turns out that there's a bug in the automatically generated meta.yml file by running conda skeleton pypi {package name}. In meta.yml, it should be pytorch instead of torch.

like image 136
Yining.L Avatar answered Sep 22 '22 17:09

Yining.L