Skip to content

Commit

Permalink
Better error message from virtualenv_create() for Ubuntu 24.04
Browse files Browse the repository at this point in the history
  • Loading branch information
t-kalinowski committed Sep 16, 2024
1 parent 6592fa7 commit db56fd2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/virtualenv.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit db56fd2

Please sign in to comment.