Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basilisk forces the use of potentially incompatible Conda binaries #191

Open
rekado opened this issue Jan 13, 2025 · 4 comments
Open

Basilisk forces the use of potentially incompatible Conda binaries #191

rekado opened this issue Jan 13, 2025 · 4 comments

Comments

@rekado
Copy link
Member

rekado commented Jan 13, 2025

You're using Basilisk to ensure that a suitable Python environment exists in which reticulate can use a number of Python packages. The problem with Basilisk is that it forces the use of Conda, which downloads binaries. These binaries have been linked with libraries that may or may not have a different ABI than those used on the user's system. For example, when using Voltron with Guix the C library very likely differs from what has been linked with the Conda binaries.

It seems to me that the use of Basilisk is not actually required if the user can guarantee a suitable Python environment. In Guix we could take care of installing the required Python packages.

While Basilisk could still be a required package, perhaps its runtime use could be toggled with a configuration option or an environment variable. Would you be open to a pull request that accomplishes this?

@Artur-man
Copy link
Collaborator

I forgot to tag the commit but we have the dev branch allowing to specify a path to python (e.g. as.AnnData) which runs reticulate using a certain python executable if exists.

VoltRon/R/conversion.R

Lines 265 to 272 in 99ae8b7

as.AnnData <- function(object,
file,
assay = NULL,
flip_coordinates = FALSE,
method = "anndata",
create.ometiff = FALSE,
python.path = NULL,
...) {

The environment necessary for installing the default environment that basilisk is also using can be found at environment.yml.

@rekado
Copy link
Member Author

rekado commented Jan 21, 2025

Is there a single location where a default for python.path could be specified? Or would I need to patch every call of any procedure that might use reticulate?

@Artur-man
Copy link
Collaborator

oh you mean if you need to specify the path everytime you call a method that use reticulate ?

Perhaps you may need something like:

options(voltron.python.path = "/path/to/python")
as.AnnData(xenium_data)

as opposed to

as.AnnData(xenium_data, python.path = "/path/to/python")

Artur-man added a commit to Artur-man/VoltRon that referenced this issue Jan 21, 2025
@Artur-man
Copy link
Collaborator

Artur-man commented Jan 21, 2025

Ok now you have now two options:

data("xenium_data")
h5ad_file <- tempfile(fileext = ".h5ad")
as.AnnData(xenium_data, file = h5ad_file, python.path = "path/to/python")

or

data("xenium_data")
h5ad_file <- tempfile(fileext = ".h5ad")
options(voltron.python.path = "path/to/python")
as.AnnData(xenium_data, file = h5ad_file)

You can run both chunks above,xenium_data is an example data embedded in the package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants