Open OMIC-coding opened 1 year ago
Hi, is the R
environment correctly installed?
Yeah,I already installed r-base(4.2.3) in the same conda environment by the code: conda install r -base=4.2.3 -c conda-forge
This could be due to a version conflict between python and R. I suggest to create a new conda environment and install the R
and rpy2
first to rule out the interference of other libraries.
Is that possible to provide a docker for this? I just found I can't successfully follow your illustration of installation. It seems that python3.8 isn't compatible with the packages within the requirement.txt file.
When I tried to import robjects from rpy2, I just encountered the error as follows:
ImportError Traceback (most recent call last) File ~/miniconda3/envs/STAligner/lib/python3.10/site-packages/rpy2/rinterface_lib/openrlib.py:18 17 try: ---> 18 import _rinterface_cffi_api as _rinterface_cffi # type: ignore 19 except ImportError as ie_api:
ImportError: libffi.so.7: cannot open shared object file: No such file or directory
During handling of the above exception, another exception occurred:
ImportError Traceback (most recent call last) Cell In[9], line 7 5 os.environ['R_HOME'] = '/home/bailab/miniconda3/envs/STAligner/lib/R' 6 os.environ['R_USER'] = '/home/bailab/miniconda3/envs/STAligner/lib/python3.10/site-packages/rpy2' ----> 7 import rpy2.robjects as robjects 8 #import rpy2.robjects.numpy2ri 10 import anndata as ad
File ~/miniconda3/envs/STAligner/lib/python3.10/site-packages/rpy2/robjects/init.py:16 14 import types 15 import typing ---> 16 import rpy2.rinterface as rinterface 17 import rpy2.rinterface_lib.embedded 18 import rpy2.rinterface_lib.openrlib ... (...) 10 _typenames = (b'\x00\x00\x00\xC5DL_FUNC',b'\x00\x00\x01\x1CDllInfo',b'\x00\x00\x01\x1EFILE',b'\x00\x00\x01\x1FParseStatus',b'\x00\x00\x01\x12R_CFinalizer_t',b'\x00\x00\x01\x20R_CMethodDef',b'\x00\x00\x01\x21R_CallMethodDef',b'\x00\x00\x01\x21R_ExternalMethodDef',b'\x00\x00\x01\x20R_FortranMethodDef',b'\x00\x00\x00\xC1R_NativePrimitiveArgType',b'\x00\x00\x00\x2DR_len_t',b'\x00\x00\x00\x0ER_xlen_t',b'\x00\x00\x00\x44Rboolean',b'\x00\x00\x00\xBERbyte',b'\x00\x00\x00\x5DRcomplex',b'\x00\x00\x01\x15Rstart',b'\x00\x00\x00\xD9SA_TYPE',b'\x00\x00\x00\x03SEXP',b'\x00\x00\x01\x23SEXPREC',b'\x00\x00\x01\x24SEXPREC_ALIGN',b'\x00\x00\x00\xC1SEXPTYPE',b'\x00\x00\x01\x25VECSEXP',b'\x00\x00\x01\x26VECTOR_SEXPREC',b'\x00\x00\x00\x64cetype_t',b'\x00\x00\x00\x4Cnchar_type',b'\x00\x00\x01\x38structRstart'), 11 )
ImportError: libffi.so.7: cannot open shared object file: No such file or directory