Skip to content

uv ignores system installed packages #2282

@RonNabuurs

Description

@RonNabuurs

While trying to implement uv in my current pipeline I came across an issue regarding dependencies.

To sketch a summary of my setup.

I'm running my pipeline in alpine, which brings some challenges. Some packages cannot be easily compiled (and don't have a wheel available), which is why I use the extra index https://github.com/alpine-wheels/index .

I use that index for packages like mysqlcient and reportlab.

My pipeline also wants to install cryptography==41.0.3, but because cryptography is available in the alpine-wheel index, it tries to install it from there. Though cryptography already has available wheels via pypi, so I don't want it to install via the alpine-wheels repo.

My thought was to first run uv once to only install cryptography, so I dont use the index. And after that I run uv with my normal dependencies via pyproject.toml. But it appears that uv doesn't see the already installed cryptography.

Because I run uv in a pipeline I use the --system flag.

See the output below:

/ # uv pip install --system cryptography==41.0.3
Resolved 3 packages in 114ms
Downloaded 3 packages in 114ms
Installed 3 packages in 6ms
 + cffi==1.16.0
 - cryptography==40.0.2
 + cryptography==41.0.3
 + pycparser==2.21
/ # uv pip install --system --extra-index-url https://alpine-wheels.github.io/index -r pyproject.toml
  x No solution found when resolving dependencies:
  `-> Because there is no version of cryptography==41.0.3 and <my-project> depends on cryptography==41.0.3, we can conclude that the requirements are unsatisfiable.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions