From db56fd2bec9842b493ef1080d90c58c72526c06b Mon Sep 17 00:00:00 2001 From: Tomasz Kalinowski Date: Mon, 16 Sep 2024 16:04:23 -0400 Subject: [PATCH] Better error message from `virtualenv_create()` for Ubuntu 24.04 https://github.com/rstudio/reticulate/issues/1544#issuecomment-2353793194 --- R/virtualenv.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/virtualenv.R b/R/virtualenv.R index 70677cf1..454517e8 100644 --- a/R/virtualenv.R +++ b/R/virtualenv.R @@ -462,8 +462,8 @@ virtualenv_module <- function(python) { # then, recommend installation of virtualenv or venv with pip commands$push(paste("Install", modules[[1]], "with:")) if (is_ubuntu() && dirname(python) == "/usr/bin") { - package <- if (py_version < "3") "python-virtualenv" else "python3-venv" - commands$push(paste("$ sudo apt-get install", package)) + packages <- if (py_version < "3") "python-virtualenv" else "python3-venv python3-pip python3-dev" + commands$push(paste("$ sudo apt-get install", packages)) } else { commands$push(paste("$", python, "-m pip install --upgrade --user", module)) } @@ -762,7 +762,7 @@ stop_no_virtualenv_starter <- function(version = NULL, python = NULL) { file.exists(python) && !python_has_modules(python, c("pip", "venv"))) { if (is_ubuntu()) - w("- sudo apt install python3-venv") + w("- sudo apt install python3-venv python3-pip python3-dev") else if (is_fedora()) w("- sudo dnf install python3-pip") else