2017-07-11 48 views
0

我想构建一个包并将它托管在anaconda上,但是我无法成功构建包并且它给了我一个我不知道如何解决的错误。Conda包构建错误

这是包的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消息。

这可能是什么原因造成的?

谢谢

回答

0

所以,我在我的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 

我试过在source部分的Jinja2模板的几种组合,但我认为path=../是我的问题的真正解决。现在它的建筑正确。