Skip to content

Using Python packages with reticulate #8

@lmweber

Description

@lmweber

Hi @js2264 , thanks for creating this excellent package.

We have been reformatting our spatial transcriptomics book using BiocBook for submission to Bioconductor, and had a question about using Python packages with reticulate.

We are trying to use the micromamba-based environment named BiocBook (mentioned in the docs at https://jserizay.com/BiocBookDemo/devel/index.html#automated-versioning-of-docker-images), but so far have been unable to get this working with the GitHub Actions workflow.

Specifically, we have modified the requirements.yml file to install some packages with pip within the BiocBook environment, and then loading these in one of the .qmd files with reticulate, but then pushing this to GitHub gives an error that the GitHub Actions workflow cannot find the Python installation / conda environment (see code examples and error message below).

Do you have any suggestions or advice on how we can do this? One idea I had is that the GitHub Actions workflow may need some updates, but I'm not sure if I'm missing something else. Also tagging @HelenaLC who is working with me on this. Thank you!

requirements.yml:

name: 
    BiocBook
channels:
    - bioconda
    - conda-forge
    - defaults
dependencies:
    - python>=3.6
    - pip
    - pip:
        - anndata
        - pandas

R code in .qmd file using reticulate:

library(reticulate)
use_condaenv("BiocBook", required = TRUE)
ad <- import("anndata")
pd <- import("pandas")

Error message from GitHub Actions workflow:

Error:
! Unable to find conda binary. Is Anaconda installed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions