Suggest correct command to create a virtual environment when encountering externally managed interpreters (#4314)

This commit is contained in:
Zanie Blue
2024-06-13 17:43:31 -04:00
committed by GitHub
parent 9647eed697
commit 92802df223
3 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -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()
))
};
+2 -2
View File
@@ -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()
))
};
+2 -2
View File
@@ -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()
))
};