Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uv --python and uv python pin fail if Python3.6 is found on the system #10898

Closed
jramcast opened this issue Jan 23, 2025 · 3 comments · Fixed by #10908
Closed

uv --python and uv python pin fail if Python3.6 is found on the system #10898

jramcast opened this issue Jan 23, 2025 · 3 comments · Fixed by #10908
Assignees
Labels
bug Something isn't working

Comments

@jramcast
Copy link

Summary

I have Python 3.10 installed at /usr/local/bin/python
Python3.6 is also available at /usr/bin/python3

Expected behavior: uv ignores the 3.6 installation.

Actuall behavior. When I try to run a command by using a specific python version, the command fails

uv -v run --python 3.9 python --version
DEBUG uv 0.5.23
DEBUG No project found; searching for Python interpreter
DEBUG Searching for Python 3.9 in virtual environments, managed installations, or search path
DEBUG Searching for managed installations at `.local/share/uv/python`
DEBUG Found `cpython-3.10.4-linux-x86_64-gnu` at `/usr/local/bin/python3` (search path)
DEBUG Skipping interpreter at `/usr/local/bin/python3` from search path: does not satisfy request `3.9`
DEBUG Found `cpython-3.10.4-linux-x86_64-gnu` at `/usr/local/bin/python` (search path)
DEBUG Skipping interpreter at `/usr/local/bin/python` from search path: does not satisfy request `3.9`
DEBUG Failed to inspect Python interpreter from search path at `/usr/bin/python3` 
DEBUG Skipping bad interpreter at /usr/bin/python3 from search path: Python 3.6.8 is not supported. Please use Python 3.8 or newer.
DEBUG Failed to inspect Python interpreter from search path at `/bin/python3` 
DEBUG Skipping bad interpreter at /bin/python3 from search path: Python 3.6.8 is not supported. Please use Python 3.8 or newer.
error: Failed to inspect Python interpreter from search path at `/usr/bin/python3`
  Caused by: Can't use Python at `/usr/bin/python3`
  Caused by: Python 3.6.8 is not supported. Please use Python 3.8 or newer.

Platform

Linux 6.12.5-200.fc41.x86_64 x86_64 GNU/Linux

Version

uv 0.5.23

Python version

Python 3.10.4

@jramcast jramcast added the bug Something isn't working label Jan 23, 2025
@zanieb
Copy link
Member

zanieb commented Jan 23, 2025

Thanks for the report! This is surprising.

Do you have a Python 3.9 interpreter available?

Does this reproduce on uv 0.5.21? I am suspicious of #10716

@jramcast
Copy link
Author

No, Python 3.9 is not initially available in the system.

Downgrading to 0.5.21 solves the issue:

$ uv run --python 3.9 python --version
Python 3.9.21

More verbose output:

$ uv -v run --python 3.9 python --version
DEBUG uv 0.5.21
DEBUG No project found; searching for Python interpreter
DEBUG Searching for Python 3.9 in virtual environments, managed installations, or search path
DEBUG Searching for managed installations at `/home/user/.local/share/uv/python`
DEBUG Found `cpython-3.10.4-linux-x86_64-gnu` at `/usr/local/bin/python3` (search path)
DEBUG Skipping interpreter at `/usr/local/bin/python3` from search path: does not satisfy request `3.9`
DEBUG Found `cpython-3.10.4-linux-x86_64-gnu` at `/usr/local/bin/python` (search path)
DEBUG Skipping interpreter at `/usr/local/bin/python` from search path: does not satisfy request `3.9`
DEBUG Failed to inspect Python interpreter from search path at `/usr/bin/python3` 
DEBUG Skipping bad interpreter at /usr/bin/python3 from search path: Can't use Python at `/usr/bin/python3`
DEBUG Failed to inspect Python interpreter from search path at `/usr/bin/python` 
DEBUG Skipping bad interpreter at /usr/bin/python from search path: Can't use Python at `/usr/bin/python`
DEBUG Failed to inspect Python interpreter from search path at `/bin/python3` 
DEBUG Skipping bad interpreter at /bin/python3 from search path: Can't use Python at `/bin/python3`
DEBUG Failed to inspect Python interpreter from search path at `/bin/python` 
DEBUG Skipping bad interpreter at /bin/python from search path: Can't use Python at `/bin/python`
DEBUG Requested Python not found, checking for available download...
DEBUG Acquired lock for `/home/user/.local/share/uv/python`
DEBUG Using request timeout of 30s
INFO Fetching requested Python...
DEBUG Downloading https://github.com/astral-sh/python-build-standalone/releases/download/20250115/cpython-3.9.21%2B20250115-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz to temporary location: /home/user/.local/share/uv/python/.temp/.tmppU5lnb
DEBUG Extracting cpython-3.9.21%2B20250115-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz
DEBUG Moving /home/user/.local/share/uv/python/.temp/.tmppU5lnb/python to /home/user/.local/share/uv/python/cpython-3.9.21-linux-x86_64-gnu
DEBUG Released lock at `/home/user/.local/share/uv/python/.lock`
DEBUG Using Python 3.9.21 interpreter at: /home/user/.local/share/uv/python/cpython-3.9.21-linux-x86_64-gnu/bin/python3.9
DEBUG Running `python --version`
Python 3.9.21
DEBUG Command exited with code: 0

@zanieb zanieb self-assigned this Jan 23, 2025
@zanieb
Copy link
Member

zanieb commented Jan 23, 2025

Great thanks!

zanieb added a commit that referenced this issue Jan 23, 2025
…10908)

Closes #10898

In #10716, I broke fallback to downloading Python versions by throwing a
different error kind.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants