Conda包构建错误

时间:2017-07-11 10:39:40

标签: python build jinja2 conda

我正在尝试构建一个软件包并将其托管在anaconda上,但我无法成功构建软件包,它给了我一个我不知道如何解决的错误。

这是包的meta.yaml内容:

package:
  name: dbcollection
  version: 0.1.5

source:
  git_url: https://github.com/farrajota/dbcollection.git
  git_rev: 0.1.5

requirements:
  build:
    - python
    - setuptools
    - h5py
    - numpy
    - patool
    - progressbar2
    - pytest
    - scipy
    - xmltodict
    - requests
    - pillow

  run:
    - python
    - h5py
    - numpy
    - patool
    - progressbar2
    - pytest
    - scipy
    - xmltodict
    - requests
    - pillow

test:
  imports:
    - dbcollection

about:
  home: https://github.com/farrajota/dbcollection
  license: MIT

这是使用conda build <recipe_path>构建程序包时收到的错误消息:

Packaging dbcollection-0.1.5-py35h1c746c7_0
INFO:conda_build.build:Packaging dbcollection-0.1.5-py35h1c746c7_0
Traceback (most recent call last):
  File "/home/mf/anaconda3/bin/conda-build", line 6, in <module>
    sys.exit(conda_build.cli.main_build.main())
  File "/home/mf/anaconda3/lib/python3.5/site-packages/conda_build/cli/main_build.py", line 340, in main
    execute(sys.argv[1:])
  File "/home/mf/anaconda3/lib/python3.5/site-packages/conda_build/cli/main_build.py", line 331, in execute
    noverify=args.no_verify)
  File "/home/mf/anaconda3/lib/python3.5/site-packages/conda_build/api.py", line 183, in build
    need_source_download=need_source_download, config=config, variants=variants)
  File "/home/mf/anaconda3/lib/python3.5/site-packages/conda_build/build.py", line 1615, in build_tree
    built_packages=built_packages,
  File "/home/mf/anaconda3/lib/python3.5/site-packages/conda_build/build.py", line 1184, in build
    built_package = bundlers[output_d.get('type', 'conda')](output_d, m, env)
  File "/home/mf/anaconda3/lib/python3.5/site-packages/conda_build/build.py", line 706, in bundle_conda
    files = post_process_files(metadata, initial_files)
  File "/home/mf/anaconda3/lib/python3.5/site-packages/conda_build/build.py", line 621, in post_process_files
    get_build_metadata(m)
  File "/home/mf/anaconda3/lib/python3.5/site-packages/conda_build/post.py", line 522, in get_build_metadata
    raise ValueError("support for __conda_version__ has been removed as of Conda-build 3.0."
ValueError: support for __conda_version__ has been removed as of Conda-build 3.0.Try Jinja templates instead: http://conda.pydata.org/docs/building/meta-yaml.html#templating-with-jinja

以下是full build log output消息。

这可能是什么原因?

谢谢

1 个答案:

答案 0 :(得分:0)

所以,我通过切换count文件中的一些字段来解决这个问题。

meta.yaml

我在package: name: dbcollection version: {{ GIT_DESCRIBE_TAG }} source: path: ../ build: number: {{ GIT_DESCRIBE_NUMBER|int }} requirements: build: - python - setuptools - h5py - numpy - patool - progressbar2 - pytest - scipy - xmltodict - requests - pillow run: - python - h5py - numpy - patool - progressbar2 - pytest - scipy - xmltodict - requests - pillow test: imports: - dbcollection about: home: https://github.com/farrajota/dbcollection license: MIT 部分尝试了几种jinja2模板组合,但我认为source是我问题的真正解决方案。现在它的建设得当。