Skip to content

Commit

Permalink
Merge pull request #1543 from colinvwood/regex-fix
Browse files Browse the repository at this point in the history
fix regex to support environments created with conda env create
  • Loading branch information
t-kalinowski authored Mar 13, 2024
2 parents 18ce0df + 80f6fca commit c616732
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
- Fixed an issue where `py_discover_config()` would discover `python` (v2) on the PATH
in preference of `python3` on the PATH. (#1547)

- Fixed an issue where reticulate would error when using conda environments created
with the (new) `conda env create` command. (#1535, #1543)

# reticulate 1.35.0

- Subclassed Python list and dict objects are no longer automatically converted
Expand Down
6 changes: 4 additions & 2 deletions R/python-tools.R
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,10 @@ python_info_condaenv_find <- function(path) {
return(NULL)

# get path to conda script used
script <- sub("^#\\s+cmd: (.+)\\s+(create|rename)\\s+.*", "\\1", lines[[1]])

script <- sub(
"^#\\s+cmd: (.+?)\\s+(env\\s+create|create|rename)\\s+.*",
"\\1", lines[[1]], perl = TRUE
)
# on Windows, a wrapper script is recorded in the history,
# so instead attempt to find the real conda binary
if(is_windows())
Expand Down

0 comments on commit c616732

Please sign in to comment.