在没有Conda的情况下从(Conda)environment.yml安装依赖项? [英] Installing dependencies from (Conda) environment.yml without Conda?

查看:89
本文介绍了在没有Conda的情况下从(Conda)environment.yml安装依赖项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前使用Conda在 environment.yml 中捕获我对python项目的依赖.

I currently use Conda to capture my dependencies for a python project in a environment.yml.

当我从项目构建docker服务时,我需要重新安装这些依赖项.我想四处走走,必须将(mini-)conda添加到我的docker映像中.

When I build a docker service from the project I need to reinstall these dependencies. I would like to get around, having to add (mini-)conda to my docker image.

是否可以使用pip/pipenv解析 environment.yml 或将其转换为相应的 requirements.txt ?

Is it possible to parse environment.yml with pip/pipenv or transform this into a corresponding requirements.txt?

(我现在还不想离开conda,因为这是我在记录模型时MLflow捕获的东西)

(I don't want to leave conda just yet, as this is what MLflow captures, when I log models)

推荐答案

不是.

  1. conda 自动安装conda软件包的依赖项.这些问题通过 pip 进行了不同的解析,因此您必须在转换脚本中解析Anaconda依赖关系树.

  1. conda automatically installs dependencies of conda packages. These are resolved differently by pip, so you'd have to resolve the Anaconda dependency tree in your transformation script.

许多 conda 软件包不是Python.您根本无法使用 pip 安装这些依赖项.

Many conda packages are non-Python. You couldn't install those dependencies with pip at all.

一些 conda 软件包包含使用Anaconda编译器工具链编译的二进制文件.即使相应的 pip 软件包可以在安装时编译此类二进制文件,也不会使用Anaconda工具链.您得到的将与相应的 conda 软件包有根本的不同.

Some conda packages contain binaries that were compiled with the Anaconda compiler toolchain. Even if the corresponding pip package can compile such binaries on installation, it wouldn't be using the Anaconda toolchain. What you'd get would be fundamentally different from the corresponding conda package.

某些 conda 软件包已应用修复程序,相应的 pip 软件包中未提供这些修复程序.

Some conda packages have fixes applied, which are missing from corresponding pip packages.

我希望这足以说服您您的想法不会实现.

I hope this is enough to convince you that your idea won't fly.

安装Miniconda并不是什么大不了的事情.只是做:-)

Installing Miniconda isn't really a big deal. Just do it :-)

这篇关于在没有Conda的情况下从(Conda)environment.yml安装依赖项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆