-
Notifications
You must be signed in to change notification settings - Fork 8
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
faulty r-reticulate conda environment #20
Comments
Thank you for reporting this. This is unexpected. Of course I already had a conda environment installed on my machine before adding this feature to later versions. Note that the .onAttach function requires that a conda environment named "r-reticulate" must be installed. It attempts to install missing dependencies there.
As you've noted this is for convenience only and the package can be used if a conda environment is already set up. This subroutine appears not to work due to different naming schemes between reticulate in R and conda in the command-line. I will investigate this to patch in a future release. Since some install steps are OS-specific, are you able to share details on which system you encountered the error? Thanks for testing it on GH Actions, that is really helpful. |
Perhaps further complicating the issue. My system (Mac OS) has multiple environments with the same name and no "base" environment.
You're right, reticulate seems to be doing something strange here so the .onLoad or .onAttach functions may not be working correctly. |
I've looked into this further and found that the default conda environment for reticulate seems to be updated from "r-reticulate" to "r-miniconda". Which version of reticulate are you using? It seems to work without duplicate environments on the new version using "r-miniconda" as a base image. So potential solutions are:
|
I was using reticulate 1.24 (the latest). I assume that's the case for GitHub Actions as well. It looks like it's still using "r-reticulate" by default, though: |
Thanks for the quick response. Sorry it's taken a long time to get back to you. Other updates to the package are necessary so I am considering whether it is possible to fix this as well. |
No problem. This is a relatively obscure error, so shouldn't be high priority. It seemed like it may have a simple fix. |
… by reticulate in R resolves conflicting environment names in conda and reticulate #20
… by reticulate in R resolves conflicting environment names in conda and reticulate #20
… by reticulate in R resolves conflicting environment names in conda and reticulate #20
if it is used by reticulate in R resolves conflicting environment names in conda and reticulate #20
if it is used by reticulate in R resolves conflicting environment names in conda and reticulate #20
Thanks for the feedback. I agree it's better to have it fixed but is more complicated than I originally expected. I tried to reproduce the error on a new machine without reticulate installed before and encountered this.
I think I have a solution so I am testing installing it from this branch (the dev branch is a major update #1):
I am able to install this version without errors on a new system. |
Leiden v0.3.10 which should resolve this has been submitted to CRAN. |
That was fast! |
The CRAN testing system has installed Python so I had some issues with checks invoking the install which writes to disk to create a conda environment. I've modified it so that it will prompt the user for consent to setting up a conda environment if it is not available and it will only run in interactive sessions (not in Rscript calls or R CMD CHECK). This version was resubmitted to CRAN and accepted this today. It is now available to installed from source and Windows/Mac binaries are building now. |
… by reticulate in R resolves conflicting environment names in conda and reticulate #20
if it is used by reticulate in R resolves conflicting environment names in conda and reticulate #20
There is an odd behavior that I encountered. If I try to use leiden as the first reticulate package, a duplicated conda environment ends up getting created. When I call
library(leiden)
, everything seems normal.Then, when I call
reticulate::conda_list()
:There are actual two
r-reticulate
environments detected, one inside the other and one of them is consideredbase
. However, they are not complete and callingreticulate::py_module_available("leidenalg")
returnsFALSE
.This is the output of
conda env list
outside R:I was able to recreate the behavior using GitHub Actions. You can check the output here (technically, there are no errors, so it's considered a successful run): https://github.com/igordot/leiden/runs/5296171878?check_suite_focus=true
If I set up
r-reticulate
environment before using leiden, everything seems fine. That might be why most people wouldn't encounter it. It seems something goes wrong when the package is trying to set up the environment.The text was updated successfully, but these errors were encountered: