This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Giotto Error: py_run_file_impl(file, local, convert) : ModuleNotFoundError: No module named 'dataclasses'

Hi,

I am trying to do Leiden Clustering, but it seems like the code doesn't work really well on my M1 MacBook Air.

Here the code I have run:

my_giotto_object_n = doLeidenCluster(gobject = my_giotto_object_n, name = "leiden_clus")

and here is the error message I got:

Error in py_run_file_impl(file, local, convert) : ModuleNotFoundError: No module named 'dataclasses'

I wonder what is wrong and please suggest what should I do to overcome this error. Thanks!

giotto modulenotfounderror

1 answer

Looks like the function requires the module dataclasses as a dependency.
Try installing the missing dependency:

pip install dataclasses

and see if that solves your problem.

Thank you for your suggestion, have installed it and use a specified python_path to execute the command, yet get this error message: enter image description here

Seems like an error due to an installation of the wrong library (it does not match your machine's architecture). Try to clean your current installation and re-install the package with a manual installation (see the instructions here).

Hope this helps.

Hi,

Thank you for your suggestion, I have created different virtual environment and after running it on R, I just realised that I use R version for intel-based Mac (x86_64-apple-darwin Bird Hippie) instead of the M1, then I changed to the R M1 (aarch64-apple-darwin20 Vigorous Calisthenics), yet upon installing the package, it gives me this error:

ERROR: dependency ‘lfa’ is not available for package ‘Giotto’

  • removing ‘/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/Giotto’

Do you have any suggestion for this issue? thank you

I finally created virtual environment for x84 for the python, so it matches with the R version and it works. Thank you for your help :D

Log in to answer this question.