-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Wrong Python path reported in uv python list #6515
Copy link
Copy link
Closed
Labels
questionAsking for clarification or supportAsking for clarification or support
Description
Hi,
I think I misunderstand uv python list command or it returns something I wouldn't expect 🤔
FROM python:3.9.19-slim-bookworm
RUN python3 -m venv /opt/venv
RUN uv pip install ruffThis fails on error: No virtual environment found
but when I add /opt/venv to $PATH
FROM python:3.9.19-slim-bookworm
RUN python3 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
RUN uv pip install ruffthen this passes and it is OK I guess.
But the small issue is that uv python list --only-installed reports the same thing in both cases (with and without $PATH replaced)
from the Docker container:
root@7d4f7b1a5615:/# echo $PATH
/usr/local/bin/
root@7d4f7b1a5615:/# uv python list --only-installed
cpython-3.9.19-linux-x86_64-gnu usr/local/bin/python3.9
cpython-3.9.19-linux-x86_64-gnu usr/local/bin/python3 -> python3.9
cpython-3.9.19-linux-x86_64-gnu usr/local/bin/python -> python3
root@7d4f7b1a5615:/# export PATH=/opt/venv/bin:$PATH
root@7d4f7b1a5615:/# echo $PATH
/opt/venv/bin:/usr/local/bin/
root@7d4f7b1a5615:/# uv python list --only-installed
cpython-3.9.19-linux-x86_64-gnu usr/local/bin/python3.9
cpython-3.9.19-linux-x86_64-gnu usr/local/bin/python3 -> python3.9
cpython-3.9.19-linux-x86_64-gnu usr/local/bin/python -> python3
I would expect /opt/venv/bin/python3 here... or do I miss/understand something?
which returns /opt/venv/bin/python3 correctly
root@7d4f7b1a5615:/# /usr/bin/which python3
/opt/venv/bin/python3
root@7d4f7b1a5615:/# /usr/bin/which python3.9
/opt/venv/bin/python3.9
uv 0.3.2
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
questionAsking for clarification or supportAsking for clarification or support