Skip to content

Commit

Permalink
Improve the error message for invalid Pythons.
Browse files Browse the repository at this point in the history
Refs #30
  • Loading branch information
mitsuhiko committed Jan 20, 2024
1 parent e6717de commit e6512f6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion docs/guide/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ a specific version download a binary directly
## Customized Installation

On some platforms there is some limited support for customizing the installation
experience.
experience. This for instance can be necessary on certain Linux environments such
as Alpine where the Rye provided Python interpreter is not supported.

=== "Linux"

Expand Down
11 changes: 8 additions & 3 deletions rye/src/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,14 @@ pub fn ensure_self_venv(output: CommandOutput) -> Result<PathBuf, Error> {
venv_cmd.arg(&venv_dir);
set_proxy_variables(&mut venv_cmd);

let status = venv_cmd
.status()
.with_context(|| format!("unable to create self venv using {}", py_bin.display()))?;
let status = venv_cmd.status().with_context(|| {
format!(
"unable to create self venv using {}. It might be that \
the used Python build is incompatible with this machine. \
For more information see https://rye-up.com/guide/installation/",
py_bin.display()
)
})?;
if !status.success() {
bail!("failed to initialize virtualenv in {}", venv_dir.display());
}
Expand Down

0 comments on commit e6512f6

Please sign in to comment.