Version Resolution failure
See original GitHub issue- I have searched the issue tracker and believe that this is not a duplicate.
Make sure you run commands with -v
flag before pasting the output.
Steps to reproduce
pdm init
pdm add packages
pdm add other_packages
=> InconsistentCandidate error
If I do pdm add packages other_packages
it works.
I guess the resolution of depencies is made in the second case but fail in the first one…
Actual behavior
Get an InconsistentCandidate error
when adding by steps (but works if adding a bunch).
Also (maybe not related) but sklearn got a version of ~=0.0
which seems to works but seems weird.
Expected behavior
Install packages normally like with pip.
Environment Information
# Paste the output of `pdm info && pdm info --env` below:
PDM version: 1.6.2
Python Interpreter: /usr/bin/python (3.9)
Project Root: /mnt/Projets/python-nlu
Project Packages: /mnt/Projets/python-nlu/__pypackages__/3.9
{
"implementation_name": "cpython",
"implementation_version": "3.9.5",
"os_name": "posix",
"platform_machine": "x86_64",
"platform_release": "5.12.9-arch1-1",
"platform_system": "Linux",
"platform_version": "#1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000",
"python_full_version": "3.9.5",
"platform_python_implementation": "CPython",
"python_version": "3.9",
"sys_platform": "linux"
}
Thanks in advance,
Have a great day
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8
Top Results From Across the Web
Package resolution failed. Couldn'… | Apple Developer Forums
Can't add any dependency via SPM and always see this error (for example, SnapKit):. Clean derived data, reset package caches, resolve package version, ......
Read more >Dependencies resolution issue: unstable-version reported ...
The resolution of the graph fails with this error: Dependencies could not be resolved because root depends on 'Internal-2' 1.2.3..<2.0.0.
Read more >Understanding dependency resolution - Gradle User Manual
If there is no version available for the highest range, the resolution will fail. If a version declared as strictly is lower than...
Read more >Dependency Resolution - pip documentation v22.3.1
The process of determining which version of a dependency to install is known as dependency resolution. This behaviour can be disabled by passing...
Read more >NuGet Package Dependency Resolution - Microsoft Learn
When an application specifies an exact version number, such as 1.2, that is not available on the feed, NuGet fails with an error...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
For your final question,
--unconstrained
controls whether the specifiers in pyproject.toml should change, not what versions should be pinned which is locked inpdm.lock
. And if my previous comment gives you the wrong impression, correct me now.Say you have following content in pyproject.toml:
And
urllib3==1.25.1
is pinned inpdm.lock
. Assume the latest version of urllib3 is1.25.6
and when you dopdm add --unconstrained requests
:--unconstrained
,<1.26
is stripped from the requirement, now the requirements are like["urllib3", "requests"]
.urllib3>=1.25.0
.urllib3==1.25.1
gets reused as it satisfies the version constraint>=1.25.0
.urllib3
inpdm.lock
is unchanged.urllib3
pyproject.toml
asurllib3~=1.25
.Note that the default strategies in step 3 and 5 can be overridden by CLI options, see how to do it by
pdm add --help
.@lazarillo Not exactly
pdm add --unconstrained requests
will relax the version constraints of existing packages to make it possible to pick another version that is compatible with the newly added package.