Suggest correct command to create a virtual environment when encountering externally managed interpreters (#4314)
This commit is contained in:
@@ -159,13 +159,13 @@ pub(crate) async fn pip_install(
|
||||
} else {
|
||||
return if let Some(error) = externally_managed.into_error() {
|
||||
Err(anyhow::anyhow!(
|
||||
"The interpreter at {} is externally managed, and indicates the following:\n\n{}\n\nConsider creating a virtual environment with `uv environment`.",
|
||||
"The interpreter at {} is externally managed, and indicates the following:\n\n{}\n\nConsider creating a virtual environment with `uv venv`.",
|
||||
environment.root().user_display().cyan(),
|
||||
textwrap::indent(&error, " ").green(),
|
||||
))
|
||||
} else {
|
||||
Err(anyhow::anyhow!(
|
||||
"The interpreter at {} is externally managed. Instead, create a virtual environment with `uv environment`.",
|
||||
"The interpreter at {} is externally managed. Instead, create a virtual environment with `uv venv`.",
|
||||
environment.root().user_display().cyan()
|
||||
))
|
||||
};
|
||||
|
||||
@@ -154,13 +154,13 @@ pub(crate) async fn pip_sync(
|
||||
} else {
|
||||
return if let Some(error) = externally_managed.into_error() {
|
||||
Err(anyhow::anyhow!(
|
||||
"The interpreter at {} is externally managed, and indicates the following:\n\n{}\n\nConsider creating a virtual environment with `uv environment`.",
|
||||
"The interpreter at {} is externally managed, and indicates the following:\n\n{}\n\nConsider creating a virtual environment with `uv venv`.",
|
||||
environment.root().user_display().cyan(),
|
||||
textwrap::indent(&error, " ").green(),
|
||||
))
|
||||
} else {
|
||||
Err(anyhow::anyhow!(
|
||||
"The interpreter at {} is externally managed. Instead, create a virtual environment with `uv environment`.",
|
||||
"The interpreter at {} is externally managed. Instead, create a virtual environment with `uv venv`.",
|
||||
environment.root().user_display().cyan()
|
||||
))
|
||||
};
|
||||
|
||||
@@ -90,13 +90,13 @@ pub(crate) async fn pip_uninstall(
|
||||
} else {
|
||||
return if let Some(error) = externally_managed.into_error() {
|
||||
Err(anyhow::anyhow!(
|
||||
"The interpreter at {} is externally managed, and indicates the following:\n\n{}\n\nConsider creating a virtual environment with `uv environment`.",
|
||||
"The interpreter at {} is externally managed, and indicates the following:\n\n{}\n\nConsider creating a virtual environment with `uv venv`.",
|
||||
environment.root().user_display().cyan(),
|
||||
textwrap::indent(&error, " ").green(),
|
||||
))
|
||||
} else {
|
||||
Err(anyhow::anyhow!(
|
||||
"The interpreter at {} is externally managed. Instead, create a virtual environment with `uv environment`.",
|
||||
"The interpreter at {} is externally managed. Instead, create a virtual environment with `uv venv`.",
|
||||
environment.root().user_display().cyan()
|
||||
))
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user