我是新建conda
包的新手。我已将该软件包上传到PyPI
,因此我遵循了有关building conda from pip package的文档。当我尝试从pyinstrument
构建pip
时,它可以工作,但是当我尝试构建软件包时,出现以下错误。
conda_build.exceptions.DependencyNeedsBuildingError: Unsatisfiable dependencies for platform osx-64: {"torch[version='>=0.4']"}
我发现了类似的问题here,但是添加 channel 并不能解决我的问题,因为
pytorch
存在于默认 channel 中。这是我的
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
关于我应该研究的方向的任何可能的解决方案或建议都将非常有帮助。谢谢!
最佳答案
事实证明,通过运行meta.yml
在自动生成的conda skeleton pypi {package name}
文件中存在错误。在meta.yml
中,它应该是pytorch
而不是torch
。
关于python - Conda构建: Unsatisfiable dependencies for platform osx-64: {"torch[version=' >=0. 4']"},我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/50883081/