Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Automatic Configuration] First package loading does not suggest to install miniconda anymore #1488

Open
astamm opened this issue Oct 6, 2023 · 6 comments

Comments

@astamm
Copy link

astamm commented Oct 6, 2023

In the Automatic Configuration section of the Managing an R Package’s Python Dependencies vignette, it says that:

Unless the user has explicitly instructed reticulate to use an existing Python environment, reticulate will prompt the user to download and install Miniconda (if necessary).

which was the behaviour I indeed used to see if no miniconda install was detected on my machine.

However now, the following behaviour occur.

If I execute the following code:

# install.packages("remotes")
# remotes::install_github("lmjl-alea/rgudhi")
library(rgudhi)
n <- 10
X <- seq_circle(n)
ac <- AlphaComplex$new(points = X)

then it triggers:

Would you like to create a default python environment for the reticulate package? (Yes/no/cancel)

while previously it used to propose to trigger reticulate::install_miniconda().

If I do

reticulate::py_config()

it triggers the same question as well, suggesting it did not detect (or at least set up) an existing Python environment either.

I am running :

  • on Mac OS (2021) Ventura 13.6 with Apple M1 Pro chip.
  • R version: 4.3.1
  • RStudio version: 2023.09.0 Build 463

Thanks in advance for your help.

@mkoohafkan
Copy link
Contributor

I also ran into this issue, and clicking "yes" in the popup did not solve it as it would try (and fail) to create a virtualenv instead. I solved it by manually creating a conda environment named "r-reticulate". It might be better to just throw an error telling the user to create a default environment named "r-reticulate" using their preferred environment manager.

@Ray569743422
Copy link

Have you tried no ?

@t-kalinowski
Copy link
Member

Beginning with reticulate version 1.31, reticulate no longer prompts users to install miniconda. Instead, if user has expressed no preference for a Python installation, reticulate will fall back to prompting users to create a default venv named "r-reticulate".

See here for a description of how reticulate selects which python installation to bind to, and how you can configure or customize the behavior: https://rstudio.github.io/reticulate/articles/versions.html

@astamm
Copy link
Author

astamm commented Mar 5, 2024

That means this documentation (https://rstudio.github.io/reticulate/articles/python_dependencies.html#installation) is out-of-date. It still says

Specifically, after the rscipy package is loaded, the following will occur:

  • Unless the user has explicitly instructed reticulate to use an existing Python environment, reticulate will prompt the user to download and install Miniconda (if necessary).

  • After this, when the Python session is initialized by reticulate, all declared dependencies of loaded packages in Config/reticulate will be discovered.

  • These dependencies will then be installed into an appropriate Conda environment, as provided by the Miniconda installation.

@t-kalinowski
Copy link
Member

That section is only applicable if Config/reticulate/autoconfigure: is in a loaded packages DESCRIPTION file.

Are you loading a package with an autoconfigure field in DESCRIPTION?

@astamm
Copy link
Author

astamm commented Mar 5, 2024

Yes, I probably should have mentioned that in the original message associated with the issue.

@t-kalinowski t-kalinowski reopened this Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants