diff --git a/crates/uv-python/python/get_interpreter_info.py b/crates/uv-python/python/get_interpreter_info.py index 84e123258..c134a0a6b 100644 --- a/crates/uv-python/python/get_interpreter_info.py +++ b/crates/uv-python/python/get_interpreter_info.py @@ -605,7 +605,10 @@ def main() -> None: "sys_prefix": sys.prefix, "sys_base_executable": getattr(sys, "_base_executable", None), "sys_executable": sys.executable, - "sys_path": sys.path, + # We prepend the location with the interpreter discovery script copied to a + # temporary path to `sys.path` so we can import it, which we have to strip later + # to avoid having this now-deleted path around. + "sys_path": sys.path[1:], "stdlib": sysconfig.get_path("stdlib"), # Prior to the introduction of `sysconfig` patching, python-build-standalone installations would always use # "/install" as the prefix. With `sysconfig` patching, we rewrite the prefix to match the actual installation