anndata
anndata copied to clipboard
ModuleNotFoundError
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 -> <Anonymous> -> 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!
I've had the same problem and I can't fix it.
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
.