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

Using Python packages with reticulate #8

Open
lmweber opened this issue Oct 2, 2024 · 0 comments
Open

Using Python packages with reticulate #8

lmweber opened this issue Oct 2, 2024 · 0 comments

Comments

@lmweber
Copy link

lmweber commented Oct 2, 2024

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?
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

1 participant