The following minimal project cannot be build with uv. It fails resolve dependencies and create a uv.lock file when build with wine
Project structure
├── Dockerfile
├── pyproject.toml
├── README.md
└── src
└── wine_error
├── __init__.py
└── main.py
With the following files
Dockerfile:
FROM tobix/pywine:3.13
WORKDIR /app
RUN wine pip install uv
COPY . .
RUN wine uv sync -v
RUN wine cmd.exe /c dir. # just to show, that uv.lock file is missing
CMD ["wine","uv", "run", "--no-sync", "python", "src/wine_error/main.py"]
main.py:
import httpx
r = httpx.get("https://example.com")
print(r.text)
pyproject.toml:
[project]
name = "wine-error"
version = "0.1.0"
description = ""
authors = [{ name = "test user", email = "test.user@example.com" }]
requires-python = ">=3.9,<3.14"
readme = "README.md"
dependencies = [
"httpx>=0.28.1",
]
[dependency-groups]
dev = ["pyinstaller"]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
When this project is build and run with
docker build . -t wine_error --platform=linux/amd64
docker run --rm -t -i --platform=linux/amd64 wine_error
it will fail with
rosetta error: invalid gdt selector index 5
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
Traceback (most recent call last):
File "Z:\app\src\wine_error\main.py", line 1, in <module>
import httpx
ModuleNotFoundError: No module named 'httpx'
The reason seems to be that during docker build uv somehow fails silently and is not creating a virtual environment and a uv.lock file.
You can see in the following output that in the end a uv.lock file does not exist, because uv simply does not seem to finish its work. It fails silently to create a virtual environment with the httpx dependency installed. Then running the docker container it will therefor fail to find the necessary dependency.
#7 [3/6] RUN wine pip install uv
#7 0.592 rosetta error: invalid gdt selector index 5
#7 0.592 error: XDG_RUNTIME_DIR is invalid or not set in the environment.
#7 4.597 Collecting uv
#7 4.706 Downloading uv-0.8.18-py3-none-win_amd64.whl.metadata (12 kB)
#7 4.770 Downloading uv-0.8.18-py3-none-win_amd64.whl (21.0 MB)
#7 6.521 ---------------------------------------- 21.0/21.0 MB 12.2 MB/s 0:00:01
#7 6.628 Installing collected packages: uv
#7 6.937 Successfully installed uv-0.8.18
#7 DONE 7.2s
#8 [4/6] COPY . .
#8 DONE 0.1s
#9 [5/6] RUN wine uv sync -v
#9 1.089 DEBUG uv 0.8.18 (c4c47814a 2025-09-17)
#9 1.101 DEBUG Found project root: `Z:\app`
#9 1.103 DEBUG No workspace root found, using project root
#9 1.106 DEBUG Acquired lock for `Z:\app`
#9 1.110 DEBUG No Python version file found in workspace: Z:\app
#9 1.111 DEBUG Using Python request `>=3.9, <3.14` from `requires-python` metadata
#9 1.111 DEBUG Checking for Python environment at: `.venv`
#9 1.113 DEBUG Searching for Python >=3.9, <3.14 in managed installations, search path, or registry
#9 1.114 DEBUG Searching for managed installations at `C:\users\root\AppData\Roaming\uv\python`
#9 1.659 error: XDG_RUNTIME_DIR is invalid or not set in the environment.
#9 1.891 DEBUG Found `cpython-3.13.7-windows-x86_64-none` at `C:Python\python.exe` (first executable in the search path)
#9 1.891 Using CPython 3.13.7 interpreter at: C:\Python\python.exe
#9 1.894 Creating virtual environment at: .venv
#9 1.895 DEBUG Using base executable for virtual environment: C:\Python\python.exe
#9 1.907 DEBUG Released lock at `C:\users\root\AppData\Local\Temp\uv-030b7ed6fbcf7226.lock`
#9 1.908 DEBUG Acquired lock for `.venv`
#9 1.916 DEBUG Using request timeout of 30s
#9 1.931 DEBUG Found static `pyproject.toml` for: wine-error @ file:///Z:/app
#9 1.931 DEBUG No workspace root found, using project root
#9 1.946 DEBUG Solving with installed Python version: 3.13.7
#9 1.946 DEBUG Solving with target Python version: >=3.9, <3.14
#9 1.956 DEBUG Adding direct dependency: wine-error*
#9 1.957 DEBUG Adding direct dependency: wine-error:dev*
#9 1.960 DEBUG Searching for a compatible version of wine-error @ file:///Z:/app (*)
#9 1.962 DEBUG Adding direct dependency: httpx>=0.28.1
#9 1.964 DEBUG Searching for a compatible version of wine-error @ file:///Z:/app (*)
#9 1.964 DEBUG Adding direct dependency: wine-error:dev==0.1.0
#9 1.965 DEBUG Acquired lock for `C:\users\root\AppData\Local\uv\cache\simple-v18\pypi\httpx.lock`
#9 1.966 DEBUG Searching for a compatible version of wine-error @ file:///Z:/app (==0.1.0)
#9 1.966 DEBUG Adding direct dependency: pyinstaller*
#9 1.969 DEBUG No cache entry for: https://pypi.org/simple/httpx/
#9 1.976 DEBUG Acquired lock for `C:\users\root\AppData\Local\uv\cache\simple-v18\pypi\pyinstaller.lock`
#9 1.976 DEBUG No cache entry for: https://pypi.org/simple/pyinstaller/
#9 2.049 rosetta error: invalid gdt selector index 5
#9 2.049
#9 DONE 2.1s
#10 [6/6] RUN wine cmd.exe /c dir
#10 1.092 Volume in drive Z has no label.
#10 1.093 Volume Serial Number is 5a00-0000
#10 1.093
#10 1.096 Directory of Z:\app
#10 1.096
#10 1.096 09/19/2025 04:29 PM <DIR> .
#10 1.096 09/19/2025 04:29 PM <DIR> ..
#10 1.097 09/19/2025 04:29 PM <DIR> .venv
#10 1.097 09/16/2025 08:53 AM 197 build-win.spec
#10 1.097 09/19/2025 04:28 PM 235 Dockerfile
#10 1.098 09/19/2025 04:06 PM 344 pyproject.toml
#10 1.098 09/16/2025 07:32 AM 2,430 README.md
#10 1.098 09/16/2025 08:24 AM <DIR> src
#10 1.098 4 files 3,206 bytes
#10 1.098 4 directories 482,602,713,088 bytes free
#10 1.099
#10 DONE 1.1s
Is this a uv bug? Or am I using uv wrongly in connection with wine? poetry on the other side seems to work fine with pywine.
The following minimal project cannot be build with uv. It fails resolve dependencies and create a uv.lock file when build with wine
Project structure
With the following files
Dockerfile:
main.py:
pyproject.toml:
When this project is build and run with
it will fail with
The reason seems to be that during docker build uv somehow fails silently and is not creating a virtual environment and a uv.lock file.
You can see in the following output that in the end a uv.lock file does not exist, because uv simply does not seem to finish its work. It fails silently to create a virtual environment with the httpx dependency installed. Then running the docker container it will therefor fail to find the necessary dependency.
Is this a uv bug? Or am I using uv wrongly in connection with wine? poetry on the other side seems to work fine with pywine.