Comments (10)
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:
https://github.com/rstudio/reticulate/blob/256e3bc440a78a8f289b214ca715e65ce6b1e43d/R/miniconda.R#L66
from leiden.
Leiden v0.3.10 which should resolve this has been submitted to CRAN.
from leiden.
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.
onAttach <- function(libname, pkgname) {
if(!reticulate::py_available()){
tryCatch({
if(!("r-reticulate" %in% reticulate::conda_list()$name)){
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.
from leiden.
Perhaps further complicating the issue. My system (Mac OS) has multiple environments with the same name and no "base" environment.
> reticulate::conda_list()
name python
2 conda /Users/tom/Library/r-miniconda/envs/conda/bin/python
7 r-reticulate /Users/tom/Library/r-miniconda/envs/r-reticulate/bin/python
11 r-reticulate /Users/tom/miniconda3/envs/r-reticulate/bin/python
conda env list
# conda environments:
base * /Users/tom/Library/r-miniconda
conda /Users/tom/Library/r-miniconda/envs/conda
r-reticulate /Users/tom/Library/r-miniconda/envs/r-reticulate
/Users/tom/miniconda3/envs/r-reticulate
You're right, reticulate seems to be doing something strange here so the .onLoad or .onAttach functions may not be working correctly.
from leiden.
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:
- update the .onLoad function to use "r-miniconda" if available
- update the DESCRIPTION to specific a minimum version of reticulate as a dependency to ensure the new environment is used
- update the documentation describing the installation process recommending pre-configured conda environments
from leiden.
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.
from leiden.
No problem. This is a relatively obscure error, so shouldn't be high priority. It seemed like it may have a simple fix.
from leiden.
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.
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
conda environment r-reticulate installed
CondaValueError: The target prefix is the base prefix. Aborting.
Unable to install python modules igraph and leidenalg
run in terminal:
conda install -n r-reticulate -c conda-forge vtraag python-igraph pandas umap learn
python modules igraph and leidenalg installed
I think I have a solution so I am testing installing it from this branch (the dev branch is a major update #1):
https://github.com/TomKellyGenetics/leiden/tree/test-conda-setup
devtools::install_github("TomKellyGenetics/leiden", ref = "test-conda-setup")
I am able to install this version without errors on a new system.
from leiden.
That was fast!
from leiden.
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.
from leiden.
Related Issues (20)
- "pandas" error while installing leiden (found what is wrong) HOT 5
- Limitation on the number of cells? HOT 13
- Error installing package HOT 13
- extracting networks from R HOT 2
- Reproducibility HOT 2
- Error updating package HOT 6
- Error while installing Leiden HOT 1
- Error in installing βleidenβ package HOT 2
- Multi_core/thread support HOT 2
- Error in r_to_py_impl(converted, convert = convert)
- install error, invalid pointer HOT 2
- RGL issue HOT 2
- install dependencies error
- Package installation segfault error on CentOS HOT 7
- Support attribute "consider_empty_community" of leidenalg.Optimiser HOT 1
- Installation errors HOT 2
- resolution parameter and number of iteration in leiden R package HOT 1
- Query about "NAs introduced by coercion to integer range" warning
- Leiden consistently unable to correctly identify installed dependencies
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from leiden.