tanaylab / metacells

Metacells - Single-cell RNA Sequencing Analysis
MIT License
86 stars 8 forks source link

AttributeError: partially initialized module 'metacells' has no attribute 'ut' #38

Closed imet-k closed 1 year ago

imet-k commented 1 year ago

When I run the code I get this message AttributeError: partially initialized module 'metacells' has no attribute 'ut'

orenbenkiki commented 1 year ago

That's strange - sounds like an issue with cyclical imports. But this doesn't happen to anyone else so you must be doing something different.

Are you using v0.8 (from pip install) or the latest version from git?

Do you see the problem if you just import metacells without anything else? If this only happens with "some other stuff" I'd look at this other stuff for cyclical import issues.

imet-k commented 1 year ago

Thank you for getting back to me so quickly. This is my pip version pip 20.2.1 from /home/kadi/.local/lib/python3.8/site-packages/pip (python 3.8)

and I only imported metacells and anndata. This is my code:

import metacells as mc
import anndata as ad
raw = ad.read_h5ad('data.h5ad')
mc.ut.set_name(raw, 'Spleen')
print(raw.shape)
orenbenkiki commented 1 year ago

And just to make sure, you just did pip install metacells, correct?

If so, this is very strange. It isn't "it works for me", it's "it works for everyone else". I can suggest uninstalling and re-installing metacells but that's just grasping at straws.

imet-k commented 1 year ago

Thank you very much. The problem is solved. I run the code in another folder. There was pycash in the old one and I don't know if it was causing some problem.