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.

pipenv sync needs to be called twice to install all VCS dependencies

See original GitHub issue

Issue description

I have a project that uses few dependencies that I install from a private Gitlab instance.

Project A requires Library X in its and mentions it solely by name. Project B requires Project A. The Pipfile of Project B contains and editable VCS dependency to Project A and Library X. When running pipenv sync for the first time, the installation fails because Pipenv tries to resolve the dependencies from using pypi. After I execute pipenv sync the second time, everything is installed as expected.

This problem does not occur, when I run pipenv sync --sequential

Expected result

VCS dependencies get resolved and installed.

Actual result

Not all VCS dependencies get resolved and installed.

Excerpt from pipenv sync --verbose:

Collecting library-x (from project-a)
  1 location(s) to search for versions of library-x:
  Getting page
  Looking up "" in the cache
  Request header has "max_age" as 0, cache bypassed
  Starting new HTTPS connection (1): "GET /simple/library-x/ HTTP/1.1" 404 13
  Status code 404 not in (200, 203, 300, 301)
  Could not fetch URL 404 Client Error: Not Found for url: - skipping
Cleaning up...
Removed build tracker '/tmp/pip-req-tracker-u9fp4m0k'
Exception information:
Traceback (most recent call last):
  File "/home/username/.local/share/virtualenvs/project-b-DmiURb3f/lib/python3.7/site-packages/pip/_internal/cli/", line 143, in main
    status =, args)
  File "/home/username/.local/share/virtualenvs/project-b-DmiURb3f/lib/python3.7/site-packages/pip/_internal/commands/", line 318, in run
  File "/home/username/.local/share/virtualenvs/project-b-DmiURb3f/lib/python3.7/site-packages/pip/_internal/", line 102, in resolve
    self._resolve_one(requirement_set, req)
  File "/home/username/.local/share/virtualenvs/project-b-DmiURb3f/lib/python3.7/site-packages/pip/_internal/", line 256, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/home/username/.local/share/virtualenvs/project-b-DmiURb3f/lib/python3.7/site-packages/pip/_internal/", line 209, in _get_abstract_dist_for
  File "/home/username/.local/share/virtualenvs/project-b-DmiURb3f/lib/python3.7/site-packages/pip/_internal/operations/", line 218, in prepare_linked_requirement
    req.populate_link(finder, upgrade_allowed, require_hashes)
  File "/home/username/.local/share/virtualenvs/project-b-DmiURb3f/lib/python3.7/site-packages/pip/_internal/req/", line 164, in populate_link = finder.find_requirement(self, upgrade)
  File "/home/username/.local/share/virtualenvs/project-b-DmiURb3f/lib/python3.7/site-packages/pip/_internal/", line 621, in find_requirement
    'No matching distribution found for %s' % req
pip._internal.exceptions.DistributionNotFound: No matching distribution found for library-x (from project-a)

Steps to replicate

$ pipenv --rm $ pipenv sync $ pipenv sync

Sorry in advance for not pasting my Pipfile and the output of pipenv --support. Both contain quite a lot of auth-tokens that I don’t want to share and I am affraid to accidentally miss when redacting the output.

I might be able to recreate the problem with a few minimal github-repositories tomorrow.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

techalchemycommented, Dec 4, 2018

luckily I know for sure this is a regression that was released, (“luckily”), so no worries on reproducing. Thanks for the report

ccasperscommented, Nov 30, 2018

So far, I had no luck in reproducing the problem from scratch 😕. Will try again later.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Advanced Usage of Pipenv - Python Packaging Authority
Dependencies of wheels provided in a Pipfile will not be captured by $ pipenv lock . There are some known issues with using...
Read more >
How to resolve Python package dependencies with pipenv?
First try clearing your dependency cache with $ pipenv lock --clear, then try the original command again. Alternatively, you can use $ pipenv...
Read more >
pipenv Documentation - Read the Docs
Installing pipenv via Homebrew or Linuxbrew will keep pipenv and all of its dependencies in an isolated virtual envi- ronment so it doesn't...
Read more >
pipenv Documentation
Pipenv is a tool that aims to bring the best of all packaging worlds (bundler, composer, npm, cargo, yarn, etc.) to the. Python...
Read more >
Pipenv install with all the flags, explained - Micah Smith
Note that both do_install and do_sync call do_init for the heavy lifting. Comparison with sync. Others have noted that this behavior is similar ......
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 Post

No results found

github_iconTop Related Hashnode Post

No results found