2017-07-11 69 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=../是我的問題的真正解決。現在它的建築正確。