LouisFaure / scFates

a scalable python suite for tree inference and advanced pseudotime analysis from scRNAseq data.
https://scfates.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
47 stars 1 forks source link

crashes due to rpy2 not finding the R install on conda #18

Closed yedeer12 closed 4 months ago

yedeer12 commented 11 months ago

After I update scFates to 1.0.3, there is a problem about rpy2. It is normal when using 1.0.2 image

LouisFaure commented 11 months ago

Hi, this seems to be an issue with rpy2 not finding your R installation. In my documentation, I show that the best course of action is to install both scFates, R and rpy2 in the same conda environment, hence the command:

os.environ['R_HOME'] = sys.exec_prefix+"/lib/R/'

Where sys.exec_prefix will automatically append the path of the python kernel you are using. It seems that in your case you are use venv for your python kernel, which I think does not allow installation of other non-python libraries in it. That is why rpy2 cannot find R .

If R is not installed in the same environment than scFates, then I would replace sys.exec_prefix by the path leading to your actual R installation which has mgcv and other dependencies installed.