dynverse / anndata

Annotated multivariate observation data in R
https://anndata.dynverse.org
Other
42 stars 3 forks source link

ModuleNotFoundError #26

Open lizchcase opened 1 year ago

lizchcase commented 1 year ago

I tried installing anndata into R using both install.packages("anndata", lib="PATH"). I am able to load the package with library(anndata), but when I read my file with read_h5ad, I get the following error:

Error in py_module_import(module, convert = convert) : ModuleNotFoundError: No module named 'anndata' Calls: read_h5ad -> -> py_module_import Execution halted

I then tried deleting anndata from my environment and reinstalling with reticulate::install_miniconda() then anndata::install_anndata(lib="PATH"). Here, miniconda installs fine, but the second statement says that anndata cannot be recognized.

Any ideas to fix this so I can read my h5ad file would be much appreciated!

mmartinezb97 commented 6 months ago

I've had the same problem and I can't fix it.

h4rvey-g commented 1 day ago

This is possibly because the Python executable that the R process is automatically loading does not match the one in the conda or virtualenv environment where anndata is installed. Try reticulate::py_config() to see which python is loaded. You can view the reticulate articles to see how to change Python binary, or just use the python in reticulate::py_config() to install anndata.