Skip to content

v0.5.27 changes behavior for uv pip sync -r requirements.txt (breaking) #11214

@mzoll

Description

@mzoll

Summary

Issue Description

0.5.27 of uv changed the behavior for by hand creating an virtual environment and trying to install packages into it.

Error is:
'''
##[error] > [builder 7/15] RUN uv pip sync --no-cache-dir -r requirements.txt:
##[error]0.312 error: No virtual environment found; run uv venv to create an environment, or pass --system to install into a non-virtual environment
'''

Running the example code with uv==0.5.26 works fine.

The Changelog for 0.5.27 does not list any differences which could explain this error.

Steps to reproduce

(Docker):

ARG PYTHON_VERSION=3.10

# === builder stage ===
FROM python:${PYTHON_VERSION}-slim AS builder

ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1

WORKDIR /detectors

RUN pip install uv==0.5.27

RUN uv --version
RUN uv venv /opt/venv --python ${PYTHON_VERSION} --no-project

ENV PATH="/opt/venv/bin:$PATH"

# install requirements.txt
COPY requirements.txt .
RUN uv pip sync --no-cache-dir -r requirements.txt # <<< Error

Platform

docker/Linux

Version

0.5.27

Python version

3.10

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