【问题标题】:Conda-Build: Unsatisfiable dependencies for platform osx-64: {"torch[version='>=0.4']"}Conda-Build:平台 osx-64 无法满足的依赖关系:{"torch[version='>=0.4']"}
【发布时间】:2018-11-25 17:48:41
【问题描述】:

我是构建 conda 包的新手。我已经将包上传到PyPI,所以我关注了这个关于building conda from pip package 的文档。当我尝试从pip 构建pyinstrument 时它可以工作,但是当我尝试构建我的包时出现以下错误。

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

我发现了一个类似的问题here,但添加频道并没有解决我的问题,因为默认频道中存在pytorch

这是我的meta.yml 文件:

{% 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

关于我应该研究哪个方向的任何可能的解决方案或建议都会非常有帮助。谢谢!

【问题讨论】:

  • 我发现默认频道甚至 conda-forge 都无法使用 torch。你添加了什么频道?
  • 你能在两个频道中找到pytorch吗?

标签: python python-3.x anaconda setuptools conda


【解决方案1】:

原来通过运行conda skeleton pypi {package name} 自动生成的meta.yml 文件中存在错误。在meta.yml 中,应该是pytorch 而不是torch

【讨论】:

  • 嗯,这不是错误。问题是 pytorch 在pypi 上以torch 分发,在conda 上以pytorch 分发,并且它在文件系统上安装为torch。所以skeleton 程序不可能知道它。我刚刚经历了同样的过程,无法弄清楚为什么 conda 没有找到 torch,直到我意识到两个发行版名称之间的不匹配。真是一团糟。但我很高兴你也想通了!
猜你喜欢
  • 1970-01-01
  • 2023-03-10
  • 1970-01-01
  • 2012-01-30
  • 1970-01-01
  • 1970-01-01
  • 2017-08-15
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多