建立conda配方时如何修复conda“ ResolvePackageNotFound”

时间:2019-06-06 09:03:23

标签: build conda snakemake

我从github下载了一个conda软件包,进行了一些修改,并希望在conda环境中构建此本地软件包并测试我的更改。问题在于,由于conda出现conda.exceptions.ResolvePackageNotFound错误,表明它未检测到snakemakefuzzywuzzy这两个软件包,因此配方的构建失败。

这是meta.yaml文件:

package:
  name: snakepipes
  version: 1.2.1

source:
  path: ../

build:
  number: 0
  noarch: python

requirements:
  build:
    - python >=3

  run:
    - python >=3
    - pandas
    - graphviz
    - pyyaml >=5.1
    - wget
    - snakemake >=5.2.3
    - fuzzywuzzy

test:
  commands:
    - DNA-mapping --help

about:
  home: 'https://snakepipes.readthedocs.org'
  license: GPL3
  summary: NGS processing pipelines from the MPI-IE
  license_file: LICENSE.txt

我尝试将noarch更改为“通用”,在requirements: build类别中添加“点子” ...

我的命令行非常标准:conda build conda-recipe/

我得到的错误消息总是相同的:

No numpy version specified in conda_build_config.yaml.  Falling back to default numpy value of 1.11
WARNING:conda_build.metadata:No numpy version specified in conda_build_config.yaml.  Falling back to default numpy value of 1.11
Adding in variants from internal_defaults
INFO:conda_build.variants:Adding in variants from internal_defaults
Attempting to finalize metadata for snakepipes
INFO:conda_build.metadata:Attempting to finalize metadata for snakepipes
Collecting package metadata: ...working... done
Solving environment: ...working... done
BUILD START: ['snakepipes-1.2.1-py_0.tar.bz2']
Collecting package metadata: ...working... done
Solving environment: ...working... done
Collecting package metadata: ...working... done
Solving environment: ...working... failed

Leaving build/test directories:
  Work:
 /home/remi/anaconda3/conda-bld/work 
  Test:
 /home/remi/anaconda3/conda-bld/test_tmp 
Leaving build/test environments:
  Test:
source activate  /home/remi/anaconda3/conda-bld/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac 
  Build:
source activate  /home/remi/anaconda3/conda-bld/_build_env 


Traceback (most recent call last):
  File "/home/remi/anaconda3/lib/python3.7/site-packages/conda_build/environ.py", line 753, in get_install_actions
    actions = install_actions(prefix, index, specs, force=True)
  File "/home/remi/anaconda3/lib/python3.7/site-packages/conda/common/io.py", line 88, in decorated
    return f(*args, **kwds)
  File "/home/remi/anaconda3/lib/python3.7/site-packages/conda/plan.py", line 473, in install_actions
    txn = solver.solve_for_transaction(prune=prune, ignore_pinned=not pinned)
  File "/home/remi/anaconda3/lib/python3.7/site-packages/conda/core/solve.py", line 107, in solve_for_transaction
    force_remove, force_reinstall)
  File "/home/remi/anaconda3/lib/python3.7/site-packages/conda/core/solve.py", line 145, in solve_for_diff
    force_remove)
  File "/home/remi/anaconda3/lib/python3.7/site-packages/conda/core/solve.py", line 242, in solve_final_state
    ssc = self._run_sat(ssc)
  File "/home/remi/anaconda3/lib/python3.7/site-packages/conda/common/io.py", line 88, in decorated
    return f(*args, **kwds)
  File "/home/remi/anaconda3/lib/python3.7/site-packages/conda/core/solve.py", line 475, in _run_sat
    conflicting_specs = ssc.r.get_conflicting_specs(tuple(final_environment_specs))
  File "/home/remi/anaconda3/lib/python3.7/site-packages/conda/resolve.py", line 852, in get_conflicting_specs
    reduced_index = self.get_reduced_index(specs)
  File "/home/remi/anaconda3/lib/python3.7/site-packages/conda/common/io.py", line 88, in decorated
    return f(*args, **kwds)
  File "/home/remi/anaconda3/lib/python3.7/site-packages/conda/resolve.py", line 356, in get_reduced_index
    specs, features = self.verify_specs(specs)
  File "/home/remi/anaconda3/lib/python3.7/site-packages/conda/resolve.py", line 244, in verify_specs
    raise ResolvePackageNotFound(bad_deps)
conda.exceptions.ResolvePackageNotFound: 
  - fuzzywuzzy
  - snakemake[version='>=5.2.3']

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/remi/anaconda3/bin/conda-build", line 11, in <module>
    sys.exit(main())
  File "/home/remi/anaconda3/lib/python3.7/site-packages/conda_build/cli/main_build.py", line 456, in main
    execute(sys.argv[1:])
  File "/home/remi/anaconda3/lib/python3.7/site-packages/conda_build/cli/main_build.py", line 447, in execute
    verify=args.verify, variants=args.variants)
  File "/home/remi/anaconda3/lib/python3.7/site-packages/conda_build/api.py", line 208, in build
    notest=notest, need_source_download=need_source_download, variants=variants)
  File "/home/remi/anaconda3/lib/python3.7/site-packages/conda_build/build.py", line 2314, in build_tree
    notest=notest,
  File "/home/remi/anaconda3/lib/python3.7/site-packages/conda_build/build.py", line 1397, in build
    create_build_envs(m, notest)
  File "/home/remi/anaconda3/lib/python3.7/site-packages/conda_build/build.py", line 1281, in create_build_envs
    raise e
  File "/home/remi/anaconda3/lib/python3.7/site-packages/conda_build/build.py", line 1271, in create_build_envs
    channel_urls=tuple(m.config.channel_urls))
  File "/home/remi/anaconda3/lib/python3.7/site-packages/conda_build/environ.py", line 755, in get_install_actions
    raise DependencyNeedsBuildingError(exc, subdir=subdir)
conda_build.exceptions.DependencyNeedsBuildingError: Unsatisfiable dependencies for platform linux-64: {"snakemake[version='>=5.2.3']", 'fuzzywuzzy'}

您知道如何解决此问题吗?

1 个答案:

答案 0 :(得分:1)

问题是您需要添加具有适当软件包的conda通道。您可以在https://anaconda.org上搜索具有所需软件包的频道。

在这种情况下,似乎bioconda具有snakemake软件包,而conda-forge具有fuzzywuzzy,因此您应该能够做到

conda build -c conda-forge -c bioconda conda-recipe/