-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Labels
enhancementNew feature or improvement to existing functionalityNew feature or improvement to existing functionality
Description
Summary
When I add a package using specific index, packages that are installed later give "No solution found when resolving dependencies" error.
Step to reproduce
- Running
uv add paddlepaddle==3.0.0 --index https://www.paddlepaddle.org.cn/packages/stable/cpu/
This will create the pyproject.toml file like this
[project]
name = "uv-index"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
"paddlepaddle==3.0.0",
]
[tool.uv]
required-environments = [
"sys_platform == 'win32'" # I add this since numpy 2.3.2 doesn't have a source distribution or wheel when I test on windows.
]
[[tool.uv.index]]
url = "https://www.paddlepaddle.org.cn/packages/stable/cpu/"
- Run
uv add matplotlib
This will return the error
× No solution found when resolving dependencies for split (markers: python_full_version >= '3.12' and sys_platform
│ == 'win32'):
╰─▶ Because there are no versions of matplotlib and your project depends on matplotlib, we can conclude that your project's requirements are unsatisfiable.
help: If you want to add the package regardless of the failed resolution, provide the `--frozen` flag to skip locking and syncing.
There are currently 2 ways to fix this
- Run
uv add matplotlib
with--index-strategy unsafe-first-match
or--index-strategy unsafe-best-match
- Edit the pyproject.toml in the
tool.uv.index
section to make the index explicit[[tool.uv.index]] url = "https://www.paddlepaddle.org.cn/packages/stable/cpu/" explicit = true
I hope there could be a way to make the index explicit right when you add it so it doesn't affect other package when installing
Example
No response
Metadata
Metadata
Assignees
Labels
enhancementNew feature or improvement to existing functionalityNew feature or improvement to existing functionality