gpt4 book ai didi

python - 如何使 conda-build 正常工作并找到 setup.py?

转载 作者:行者123 更新时间:2023-12-03 19:17:58 24 4
gpt4 key购买 nike

我正在尝试创建一个 anaconda python 包。我的 meta.yaml看起来像这样:

package:
name: liveprint-lib
version: "0.1.0"

build:
number: 0

requirements:
build:
- pip
- python=3.7
- setuptools
run:
- python=3.7
- numpy
- opencv

about:
home: https://github.com/monomonedula/liveprint
license: Apache License 2.0
license_file: LICENSE.txt
summary: Python utility library for dynamic animations projections
build.sh :
$PYTHON setup.py install

文件夹结构:
.
├── bld.bat
├── build.sh
├── LICENSE.txt
├── liveprint
├── meta.yaml
├── README.md
├── resources
├── setup.py
└── test

运行时遇到的错误 conda build .如下:
/home/vhhl/programs/anaconda3/conda-bld/liveprint-lib_1581422598848/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/bin/python: can't open file 'setup.py': [Errno 2] No such file or directory

我究竟做错了什么?

最佳答案

您的 meta.yaml文件丢失 source部分。此外,通常最好将您的配方文件保存在它们自己的目录中,而不是放在顶级存储库中。我推荐以下内容:

mkdir conda-recipe
mv meta.yaml build.sh bld.bat conda-recipe
然后,编辑 meta.yaml添加 source部分,它指向你的 repo 的顶级目录。
package:
name: liveprint-lib
version: "0.1.0"

source:
# Relative path to the parent directory.
path: ..

build:
number: 0

requirements:
build:
- pip
- python=3.7
- setuptools
run:
- python=3.7
- numpy
- opencv
然后尝试:
conda build conda-recipe

关于python - 如何使 conda-build 正常工作并找到 setup.py?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60168579/

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