mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-17 22:07:47 +00:00
Search for python3
in unix virtual environments (#3798)
This commit is contained in:
parent
73b6a80f23
commit
99b8633ce3
3 changed files with 15 additions and 4 deletions
|
@ -115,8 +115,19 @@ pub(crate) fn virtualenv_python_executable(venv: impl AsRef<Path>) -> PathBuf {
|
|||
// If none of these exist, return the standard location
|
||||
default_executable
|
||||
} else {
|
||||
// Search for `python` in the `bin` directory.
|
||||
venv.join("bin").join("python")
|
||||
// Check for both `python3` over `python`, preferring the more specific one
|
||||
let default_executable = venv.join("bin").join("python3");
|
||||
if default_executable.exists() {
|
||||
return default_executable;
|
||||
}
|
||||
|
||||
let executable = venv.join("bin").join("python");
|
||||
if executable.exists() {
|
||||
return executable;
|
||||
}
|
||||
|
||||
// If none of these exist, return the standard location
|
||||
default_executable
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue