【发布时间】:2020-10-21 07:57:42
【问题描述】:
我尝试创建自己的(第一个)conda 包,最近几个晚上在 google、stack-overflow 和我的终端之间切换。我坚持以下几点:
我可以使用conda build . 从我的项目(名为mcm)目录成功构建。之后,我按预期在<my-dev-env>/conda-bld/noarch/mcm-v1.0a4-py_0.tar.bz2 中找到了压缩包。
现在我会发现在新环境中测试包是很自然的:
conda create -n test
conda activate test
conda install --use-local mcm
但是找不到包 - 可能是合乎逻辑的,因为test 不知道我的其他环境。我也从我的开发环境中尝试了相同的结果
conda install -n test --use-local mcm
错误总是如下:
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
PackagesNotFoundError: The following packages are not available from current channels:
- mcm
... [list of channels follows]
当然,我可以使用实际 tarball 文件的路径进行安装,但它会排除依赖项,如 here 所述。
我的实际问题是如何做到这一点,但也(不)确认我的唠叨感觉我做错了。我也在conda-build 文档页面上阅读了很多内容,尤其是here。
或者为自己的项目构建conda 包(不打算在工作同事之外发布)过度杀伤力,因为用setuptools 构建pip 包似乎容易得多?我刚刚受到使用pip 安装可能会破坏conda 依赖项的说法的影响。
【问题讨论】:
标签: conda environment conda-build