set UV_PYTHON when running maturin develop with uv#3236
Merged
Conversation
messense
approved these changes
Jun 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If
UV_PYTHONis set (e.g. as a default of 3.14 in my.zshrc) and it does not match the current.venvselected, then maturin develop will fail with a version mismatch:$ uvx maturin develop 🐍 Found CPython 3.11 at /Users/david/Dev/pyo3-scratch/.venv/bin/python 🔗 Found pyo3 bindings Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.01s 📦 Built wheel for CPython 3.11 to /var/folders/nt/_zn9g40n6rj9ls6qj3l1g_840000gn/T/.tmpzuneLp/pyo3_scratch-0.1.0-cp311-cp311-macosx_11_0_arm64.whl 💥 maturin failed Caused by: uv pip install in /Users/david/Dev/pyo3-scratch/.venv failed running ["pip", "install", "--no-deps", "--force-reinstall", "/var/folders/nt/_zn9g40n6rj9ls6qj3l1g_840000gn/T/.tmpzuneLp/pyo3_scratch-0.1.0-cp311-cp311-macosx_11_0_arm64.whl"]: exit status: 1 --- Stdout: --- Stderr: × No solution found when resolving dependencies: ╰─▶ Because only pyo3-scratch==0.1.0 is available and pyo3-scratch==0.1.0 has no wheels with a matching Python version tag (e.g., `cp314`), we can conclude that all versions of pyo3-scratch cannot be used. And because you require pyo3-scratch, we can conclude that your requirements are unsatisfiable. ---By setting
UV_PYTHONto the path of the maturin-resolved python interpreter as part of theinstall_backendcommand, this problem goes away.