conda安装在测试环境中

时间:2020-06-30 22:45:31

标签: conda environment conda-build

我尝试创建自己的(第一个)conda程序包,在最近的晚上度过了Google,堆栈溢出和我的终端之间的切换。我坚持以下几点:

我可以使用mcm从我的项目(名为conda build .)目录中成功构建。之后,我按预期在<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所述。

我的实际问题是如何使这项工作,但同时也(取消)确认我na的感觉是我做错了一切。我在conda-build文档页面上也读了很多书,尤其是here

还是为自己的项目构建conda软件包(不打算向在职同事之外发布)太过大了,因为使用pip构建setuptools软件包似乎容易得多?我只是受到这样一种说法的影响:使用pip进行安装可能会破坏conda的依赖性。

1 个答案:

答案 0 :(得分:0)

我发现了以下问题:https://github.com/conda/conda/issues/7024。这张票被标记为已关闭,但是我似乎仍然对sorted( instances, key=lambda i: (getattr(i, 'complete_date', None) is None, getattr(i, 'complete_date', None)) ) 有此问题。

好吧,这里介绍的变通方法对我来说很有效,例如

conda 4.8.3

这至少是第一步。

现在,与亲爱的同事分享,我发现了这个: How can I host my own private conda repository?。理想情况下,它应该位于文件服务器上,但是在工作中,我们现在受到了OneDrive的困扰。也许那也会做。