我是建立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 skeleton pypi {package name},自动生成的meta.yml文件中存在一个错误.在meta.yml中,它应该是pytorch而不是torch.