question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Debugging piptools.exceptions.NoCandidateFound

See original GitHub issue

In trying to convert a fairly large project from requirements.txt (201 lines) to start using pipenv. The following took about 50 minutes to run (“Converting…” was very slow).

It ended with this piptools.exceptions.NoCandidateFound error, that also happens any additional time I run pipenv install now.

I assume this is due to some dependency version mismatch (which pip never complained about before). The problem is that there doesn’t seem to be an easy way to see which dependencies are asking for conflicting versions of Flask.

I was able to manually find and fix one of the conflicts by running pipdeptree -r -p Flask in my old pip virtualenv, but now pipdeptree shows them as resolved, yet this error persists.

Is there some way to see the dependency tree or see which dependencies are causing this error? (As far as I know, all my deps should now be okay with Flask==0.9)

$ pipenv install        
Requirements file found, instead of Pipfile! Converting...
No package provided, installing all dependencies.
Pipfile found at /Users/me/Sites/foo/Pipfile. Considering this to be the project home.
Pipfile.lock not found, creating...
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
Traceback (most recent call last):
  File "/Users/philfreo/Library/Python/2.7/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/Users/philfreo/Library/Python/2.7/lib/python/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Users/philfreo/Library/Python/2.7/lib/python/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Users/philfreo/Library/Python/2.7/lib/python/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/philfreo/Library/Python/2.7/lib/python/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/philfreo/Library/Python/2.7/lib/python/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/philfreo/Library/Python/2.7/lib/python/site-packages/pipenv/cli.py", line 892, in install
    do_init(dev=dev, allow_global=system, ignore_hashes=ignore_hashes, ignore_pipfile=ignore_pipfile, skip_lock=skip_lock)
  File "/Users/philfreo/Library/Python/2.7/lib/python/site-packages/pipenv/cli.py", line 663, in do_init
    do_lock(no_hashes=no_hashes)
  File "/Users/philfreo/Library/Python/2.7/lib/python/site-packages/pipenv/cli.py", line 492, in do_lock
    results = resolve_deps(deps, sources=project.sources)
  File "/Users/philfreo/Library/Python/2.7/lib/python/site-packages/pipenv/utils.py", line 49, in resolve_deps
    for result in r.resolve():
  File "/usr/local/lib/python2.7/site-packages/piptools/resolver.py", line 107, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "/usr/local/lib/python2.7/site-packages/piptools/resolver.py", line 187, in _resolve_one_round
    best_matches = set(self.get_best_match(ireq) for ireq in constraints)
  File "/usr/local/lib/python2.7/site-packages/piptools/resolver.py", line 187, in <genexpr>
    best_matches = set(self.get_best_match(ireq) for ireq in constraints)
  File "/usr/local/lib/python2.7/site-packages/piptools/resolver.py", line 245, in get_best_match
    best_match = self.repository.find_best_match(ireq, prereleases=self.prereleases)
  File "/usr/local/lib/python2.7/site-packages/piptools/repositories/pypi.py", line 116, in find_best_match
    raise NoCandidateFound(ireq, all_candidates)
piptools.exceptions.NoCandidateFound: Could not find a version that matches Flask==0.9,>=0.10,>=0.7,>=0.8,>=0.9
Tried: 0.1, 0.2, 0.3, 0.3.1, 0.4, 0.5, 0.5.1, 0.5.2, 0.6, 0.6.1, 0.7, 0.7.1, 0.7.2, 0.8, 0.8.1, 0.9, 0.10, 0.10.1, 0.11, 0.11, 0.11.1, 0.11.1, 0.12, 0.12, 0.12.1, 0.12.1, 0.12.2, 0.12.2

I suppose this is a dupe of https://github.com/jazzband/pip-tools/issues/165, but I figured I’d start here because pipenv causes this error while pip isn’t.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
kennethreitzcommented, Sep 9, 2017

oh it’s lock --verbose

1reaction
patrick91commented, Sep 9, 2017

I have the same issue when trying to install a dev version of graphene:

pipenv install "graphene>=2.0.dev20170802065539"
Installing graphene>=2.0.dev20170802065539...
Adding graphene>=2.0.dev20170802065539 to Pipfile's [packages]...
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
Traceback (most recent call last):
  File "/Users/patrick/.pyenv/versions/3.6.0/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/Users/patrick/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Users/patrick/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Users/patrick/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/patrick/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/patrick/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/patrick/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/cli.py", line 989, in install
    do_lock(no_hashes=no_hashes)
  File "/Users/patrick/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/cli.py", line 531, in do_lock
    results = resolve_deps(deps, sources=project.sources, hashes=(not no_hashes))
  File "/Users/patrick/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/utils.py", line 62, in resolve_deps
    resolved_tree = resolver.resolve()
  File "/Users/patrick/.pyenv/versions/3.6.0/lib/python3.6/site-packages/piptools/resolver.py", line 107, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "/Users/patrick/.pyenv/versions/3.6.0/lib/python3.6/site-packages/piptools/resolver.py", line 187, in _resolve_one_round
    best_matches = set(self.get_best_match(ireq) for ireq in constraints)
  File "/Users/patrick/.pyenv/versions/3.6.0/lib/python3.6/site-packages/piptools/resolver.py", line 187, in <genexpr>
    best_matches = set(self.get_best_match(ireq) for ireq in constraints)
  File "/Users/patrick/.pyenv/versions/3.6.0/lib/python3.6/site-packages/piptools/resolver.py", line 245, in get_best_match
    best_match = self.repository.find_best_match(ireq, prereleases=self.prereleases)
  File "/Users/patrick/.pyenv/versions/3.6.0/lib/python3.6/site-packages/piptools/repositories/pypi.py", line 116, in find_best_match
    raise NoCandidateFound(ireq, all_candidates)
piptools.exceptions.NoCandidateFound: Could not find a version that matches graphene>=2.0.dev20170802065539
Tried: 0.1.0, 0.1.1, 0.1.2, 0.1.3, 0.1.4, 0.1.5, 0.1.5.1, 0.1.5.2, 0.1.5.3, 0.1.6a1, 0.1.6.0, 0.1.6.1, 0.3.0, 0.4.0, 0.4.0.1, 0.4.1, 0.4.1.1, 0.4.2, 0.4.3, 0.5.0, 0.6.0, 0.6.1, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.8.0, 0.8.1, 0.9b1, 0.9, 0.9.1, 0.10.0, 0.10.1, 0.10.2, 1.0.dev20160815004752, 1.0.dev20160816073455, 1.0.dev20160822080320, 1.0.dev20160823061102, 1.0.dev20160909040318, 1.0.dev20160909055438, 1.0.dev20160911044410, 1.0.dev20160911051803, 1.0.dev20160917190505, 1.0.dev20160918041239, 1.0.dev20160920015515, 1.0.dev20160920070441, 1.0.dev20160921153356, 1.0.dev20160922020647, 1.0, 1.0.1, 1.0.2, 1.1, 1.1.1, 1.1.2, 1.1.3, 1.2, 1.3, 1.4, 1.4.1, 2.0.dev20170724064308, 2.0.dev20170725043308, 2.0.dev20170725061556, 2.0.dev20170727024417, 2.0.dev20170727061432, 2.0.dev20170801053013, 2.0.dev20170801053013, 2.0.dev20170802065539, 2.0.dev20170802065539

This works with standard pip

Read more comments on GitHub >

github_iconTop Results From Across the Web

Release 6.11.1.dev0+geb48193.d20221201 pip-tools ...
The pip-compile command lets you compile a requirements.txt file from your dependencies, specified in either pyproject.toml, setup.cfg, ...
Read more >
Python click 模块,Context() 实例源码 - 编程字典
n' 'Install it manually with: "pip install pip-tools"\n' 'Or install all ... def catch_all(func): """ Catch (nearly) all exceptions unless in debug mode....
Read more >
Products.PDBDebugMode - PyPI
Post-mortem debugging on Zope exceptions. ... When Zope is running in debug mode this product hooks PDB debugging into various parts of a...
Read more >
Pip-tools - The Blue Book
With pip-tools, the dependency management is trivial. Install the tool: pip install pip-tools. Set the general dependencies in the ...
Read more >
Better Python Dependency Management with pip-tools
One of our developers looked into using pip-tools to improve the ... that starts with -r base.txt and then adds django-debug-toolbar etc, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found