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.

Cannot resolve packages that are split among multiple sources, on 2022.4.8

See original GitHub issue

Issue description

If I make a Pipfile with multiple sources, pipenv 2022.4.8 fails for any package that doesn’t exist in the first source. Older versions of pipenv including 2022.3.28 worked. This seems like it could be related to #5042.

  1. Set up a Pipfile with multiple sources (PyPI and a private source that only contains private packages).
  2. Add a package from each source to the Pipfile (aka numpy and a private package that’s not on PyPI).
  3. Pipenv 2022.4.8 cannot find the private package if PyPI is listed as the first source, or cannot find numpy if the private source is listed first. (pipenv lock fails)
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
  You can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
  Hint: try $ pipenv lock --pre if it is a pre-release dependency.
ERROR: No matching distribution found for my-package

This was not an issue with pipenv 2022.3.28 (tested it).

I will add that specifying which index to use for the packages that come from the 2nd listed source works. However, this gets complex when I have a package from the 2nd listed source (ie an index of corporate packages), and that package has dependencies on both standard python libraries from the first source and on private packages from the 2nd source. I’d really like to not have to re-list every transitive dependency in the Pipfile with the right source to pull it from.

Expected result

Pipenv resolves packages from both pypi and the private source.

Actual result

Pipenv fails to resolve any package that doesn’t exist in the first source.

Steps to replicate

(above)

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

1reaction
ericPrincecommented, Apr 18, 2022

It is interesting to note that pipenv install --skip-lock will successfully find and install packages from the multiple specified indexes, even if pipenv lock can’t. It would be really nice to have a feature in pipenv (command line flag or config setting) that lets pipenv try to resolve a package from all sources in order when locking, if the source isn’t specified for that package.

It would even be nice if, when you specify a source in the Pipfile, you could specify if it’s allowed to be used to find any packages, or if it can only be used for packages that list it as the source. I think that would maintain security of the lock, but allow a user to turn on this convenient but potentially unsafe behavior for sources they trust.

1reaction
matteiuscommented, Apr 18, 2022

@ericPrince Yes somewhat intentional, but I can see where maybe future improvements around how to specify the indexes of sub-dependencies might be helpful rather than the current behavior of getting the default index. Say for example you had two private package servers, each with transitive dependencies on the same server – there is no good way for the non default server to get the transitive dependencies from the secondary index without specifying every requirement and that it should come from that secondary index.

I’ve thought about this exotic use case, but the problem is how to implement the ability to say transitive dependencies should get the same index as the parent is non-trivial to solve for and may cross into the pipenv-pip boundary for which we want to minimize as much patching of pip as possible.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pipenv Documentation - Read the Docs
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 >
Oracle Fusion Cloud Project Management 22B What's New
Project contract lines are associated to multiple projects and tasks, each of which has a separate funded amount. Progress is measured as actual...
Read more >
Release and Version History — pipenv 2022.12.20.dev0 ...
Fix issue where resolver is provided with install_requires constraints from setup.py that depend on editable dependencies and could not resolve them.
Read more >
Question - Building multiple catalogs - Unity Forum
For Unity, it shouldn't make a difference whether you have one huge catalog or many small catalogs. However, if assets are split across...
Read more >
Shedding a Light on USPS Service Performance
I have a package that was split between DHL and USPS. ... from my local post office, Went to the post office and...
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