Closed lizchcase closed 1 week ago
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
.
Hi all!
Indeed, reticulate seems to not be able to find the python anndata. If you don't manage to install it with anndata::install_anndata()
, it might help to manually select which python you're using. See this documentation for more information.
I will close this issue since it's related to reticulate / miniconda.
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!