Skip to content

Commit

Permalink
Improve error message if only Python>=3.12 installed
Browse files Browse the repository at this point in the history
  • Loading branch information
t-kalinowski committed Jan 31, 2024
1 parent 203271a commit 9889142
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion R/install.R
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,15 @@ function(method = c("auto", "virtualenv", "conda"),

available <- reticulate::virtualenv_starter(version = ">=3.9", all = TRUE)
# pick the smallest minor version, ignoring patchlevel
if(nrow(available))
if(nrow(available)) {
python_version <- min(available$version[, 1:2])
if(python_version >= "3.12" && isTRUE(grepl("default", version)))
stop(
"The current release version of TensorFlow requires a Python version between 3.8 and 3.11. ",
"Python versions >=3.12 are not supported. Please use ",
"`reticulate::install_python('3.10:latest')` or manually install an older version of Python from www.python.org/downloads"
)
}
}

if (isTRUE(new_env)) {
Expand Down

0 comments on commit 9889142

Please sign in to comment.