3

I downloaded a conda package from github to bring a few modifications and would like to build this local package in a conda environment and test my changes. The problem is that the building of the recipe fails because conda has a conda.exceptions.ResolvePackageNotFound error stating that it does not detect 2 packages, snakemake and fuzzywuzzy.

Here is the meta.yaml file:

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

I tried to change the noarch into" generic", to add "pip" in the requirements: build category...

My command line is quite standard: conda build conda-recipe/.

The error message I get is always the same:

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'}

Do you know how to fix this ?

Anoikis
  • 105
  • 1
  • 13
  • 1
    Try `conda build -c conda-forge conda-recipe/` – darthbith Jun 06 '19 at 13:54
  • It resolved the `fuzzywuzzy` problem but not the `snakemake` :/ – Anoikis Jun 06 '19 at 14:44
  • 2
    The problem is that you need to add conda channels that have the appropriate packages. You can search at https://anaconda.org for channels that have the packages you need. In this case, it seems like bioconda has the snakemake package, so you should be able to do `conda build -c conda-forge -c bioconda conda-recipe/` – darthbith Jun 06 '19 at 14:47
  • Ok, I am not used at all to using conda in local mode so I was very baffled by this error message. I understand now what the problem was. Thanks a lot. – Anoikis Jun 06 '19 at 16:20

1 Answers1

8

The problem is that you need to add conda channels that have the appropriate packages. You can search at https://anaconda.org for channels that have the packages you need.

In this case, it seems like bioconda has the snakemake package and conda-forge has fuzzywuzzy so you should be able to do

conda build -c conda-forge -c bioconda conda-recipe/
darthbith
  • 18,484
  • 9
  • 60
  • 76