jingshuw / SAVERX

R package for transfer learning of single-cell RNA-seq denoising
29 stars 9 forks source link

ModuleNotFoundError: No module named 'scanpy.api' #25

Closed inoue0426 closed 2 years ago

inoue0426 commented 2 years ago

Hi,

I got this error when using SAVERX.

RRuntimeError                             Traceback (most recent call last)
Input In [3], in <cell line: 1>()
----> 1 r('''
      2     file <- saverx("./test.csv")
      3     denoised.data <- readRDS(file)
      4 ''')

File ~/.local/lib/python3.9/site-packages/rpy2/robjects/__init__.py:459, in R.__call__(self, string)
    457 def __call__(self, string):
    458     p = rinterface.parse(string)
--> 459     res = self.eval(p)
    460     return conversion.get_conversion().rpy2py(res)

File ~/.local/lib/python3.9/site-packages/rpy2/robjects/functions.py:202, in SignatureTranslatedFunction.__call__(self, *args, **kwargs)
    200         v = kwargs.pop(k)
    201         kwargs[r_k] = v
--> 202 return (super(SignatureTranslatedFunction, self)
    203         .__call__(*args, **kwargs))

File ~/.local/lib/python3.9/site-packages/rpy2/robjects/functions.py:125, in Function.__call__(self, *args, **kwargs)
    123     else:
    124         new_kwargs[k] = cv.py2rpy(v)
--> 125 res = super(Function, self).__call__(*new_args, **new_kwargs)
    126 res = cv.rpy2py(res)
    127 return res

File ~/.local/lib/python3.9/site-packages/rpy2/rinterface_lib/conversion.py:45, in _cdata_res_to_rinterface.<locals>._(*args, **kwargs)
     44 def _(*args, **kwargs):
---> 45     cdata = function(*args, **kwargs)
     46     # TODO: test cdata is of the expected CType
     47     return _cdata_to_rinterface(cdata)

File ~/.local/lib/python3.9/site-packages/rpy2/rinterface.py:813, in SexpClosure.__call__(self, *args, **kwargs)
    806     res = rmemory.protect(
    807         openrlib.rlib.R_tryEval(
    808             call_r,
    809             call_context.__sexp__._cdata,
    810             error_occured)
    811     )
    812     if error_occured[0]:
--> 813         raise embedded.RRuntimeError(_rinterface._geterrmessage())
    814 return res

RRuntimeError: Error in py_module_import(module, convert = convert) : 
  ModuleNotFoundError: No module named 'scanpy.api'

Probably "scanpy.api" is deprecated. Could you fix this?

jingshuw commented 2 years ago

Fixed

dn-ra commented 2 years ago

Hello,

Thanks for your work on this.

I got the same error today after pip install sctransfer and testing with import sctransfer.api in a python console. Any chance the fix might not have made it through to the pip package?

Thanks