Closed berniejmulvey closed 7 months ago
Alright, a complete wipe of my R, Rstudio, and anaconda, and re-installing all of my previously installed packages fixed things, but I think the workaround that was really key was the following. I was getting errors about the absence of zlib.1.dylib, even when masking out my custom $PATH variables from the R session, when zellkonverter tried to build its environment via basilisk. (This was an issue before wiping the packages as well, after I removed the entire basilisk directory from Caches per below).
For a Mac user, remove any subdirectories in /Users/YOU/Library/Caches/org.R-project.R/R/basilisk
Open an R session and run remove.packages(c("reticulate","basilisk","zellkonverter","basilisk.utils"))
Close the R session
In a new session, run: BiocManager::install("zellkonverter") library(reticulate) reticulate::install_miniconda()
In Rstudio, go to Tools --> Global Options --> Python, and click Select...
Choose the Conda Environments tab and choose the r-reticulate environment that was built by the commands in step 4 (mine was at ~/Library/r-miniconda-arm64/envs/r-reticulate/bin/python3.9 ).
At this point, basilisk.utils::install_conda was still returning an error. I incidentally found something that I was hoping would give me a more explanatory error message, but instead, the conda installation finally worked when commanded this way, but ONLY if run in a fresh command line / R.app session (!): library(basilisk.installConda()
NOW load zellkonverter and try example(SCE2AnnData), which should successfully create the conda environment and yield a new object in the workspace, roundtrip.
Confirm that other functions, e.g. sce <- readH5AD work as expected.
Why it worked is for someone above my level of knowledge, but hopefully this is a useful reference if someone else gets stuck with this issue.
Thanks for sharing what you tried. Unfortunately things sometimes get mixed up, particularly when you are also using things like homebrew.
One note for anyone who reads this later. SCE2AnnData()
operates in whichever Python environment is detected by {reticulate} unlike readH5AD()
which operates in a special {basilisk} environment. Which to use depends on how experienced you are with Python but we recommend readH5AD()
for new users. Doing work using {reticulate} and then calling readH5AD()
can sometimes cause issues because there are two environments being used.
Hi,
After several months of not utilizing the zellkonverter package for no particular reason, I came back to some code I had previously used and began encountering segfaults on my personal computer. The datasets I was trying to load were moderately large (though well within the 32GB RAM + 500GB swap allocated to my R session).
I have already tried the following things, most comprehensively in this order: •Run basilisk.utils::clearExternalDir() •remove.packages(c("basilisk","reticulate","zellkonverter") •reinstalling baslisk, reticulate, zellkonverter individually, with or without type set to "source" •reinstalling only zellkonverter and letting the installer handle the reticulate/basilisk dependencies •remove ~/anaconda3 , ~/.anaconda , ~/.conda , ~/.miniconda , ~/mambaforge directories and reinstall Anaconda for Mac, followed by both tries at R package reinstallations above •manually initializing a basilisk environment before running zellkonverter for the "first" time using basilisk::setupBasiliskEnv() •removing opt/homebrew/bin from $PATH entirely to prevent conflicts with brew's python •placing opt/homebrew/bin at the very end of $PATH to include homebrew but guarantee other python binaries supercede homebrew
Regardless, I get this segfault at most or a total crash of R and RStudio (I can get the segfault messages reliably running R from a command line window):
Minimal example:
Example output (after package loading messages, etc):
Then, bizarrely at this point, I get several errors before/while I try and choose a “possible action” before I can actually send a response:
Finally, some miscellany: sessionInfo()
Makevars (which have not changed since I originally installed and successfully used zellkonverter many moons ago):
System $PATH as reported from within R.app / Rstudio (which is something R devs are aware of being discrepant/redundant relative to the command line reported $PATH on M-family Macs). Currently is excluding homebrew altogether.