gpt4 book ai didi

python - 使用 conda-build 构建 conda 包时如何包含 pip-only 包?

转载 作者:行者123 更新时间:2023-12-04 15:18:47 26 4
gpt4 key购买 nike

我想为我的项目构建一个 Conda 包。但是,有一个包仅在 pip 上(未上传到 Conda channel )。使用 conda-build 命令时如何仅包含 pip 包?
我尝试使用 Conda 框架从 PyPI URL 构建包,但它不起作用,因为 PyPI 站点上的文件是 .whl 文件,而不是像 conda 框架教程中的 tar.gz 文件。我应该如何解决这个问题?
这是我在运行 conda 构建时遇到的错误。

conda_build.exceptions.DependencyNeedsBuildingError: Unsatisfiable dependencies for platform osx-64: {'plaidml'}
并使用 conda skeleton pypi plaidml-keras 为 plaidml 包构建骨架
Error: No source urls found for plaidml-keras
在构建 conda 包时,是否有关于如何包含 pip only 包的好做法?

最佳答案

我在 conda-build 文档中环顾四周,看起来您可以使用轮子作为依赖项构建 conda 包。来自 conda-build user guide docs :

To build a conda package from a wheel file, install the .whl file inthe conda recipe's bld.bat or build.sh file.

You may download the .whl file in the source section of the condarecipe's meta.yaml file.

You may instead put the URL directly in the pip install command.

EXAMPLE: The conda recipe for TensorFlow has a pip install command inbuild.sh with the URL of a .whl file. The meta.yaml file does notdownload or list the .whl file.

Note

It is important to pip install only the one desired package. Wheneverpossible, install dependencies with conda and not pip.

We strongly recommend using the --no-deps option in the pip installcommand.

If you run pip install without the --no-deps option, pip will ofteninstall dependencies in your conda recipe and those dependencies willbecome part of your package. This wastes space in the package andincreases the risk of file overlap, file clobbering, and brokenpackages.

关于python - 使用 conda-build 构建 conda 包时如何包含 pip-only 包?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63804392/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com