Installing dependencies from (Conda) environment.yml without Conda?

前提是你 提交于 2021-02-08 08:25:22

问题


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

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.

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

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


回答1:


Nope.

  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.

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

  3. 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.

  4. 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.

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



来源:https://stackoverflow.com/questions/56700687/installing-dependencies-from-conda-environment-yml-without-conda

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!