rstudio / reticulate

R Interface to Python
https://rstudio.github.io/reticulate
Apache License 2.0
1.68k stars 327 forks source link

GHA failure of `reticulate::install_miniconda()` on Windows R 3.6 #1464

Open AshesITR opened 1 year ago

AshesITR commented 1 year ago

Trying reticulate::install_miniconda() on GHA with the following matrix config fails only for windows on R 3.6. Is this intentional? I've disabled the config for now.

# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
  push:
    branches: [main, master]
  pull_request:
    branches: [main, master]

name: R-CMD-check

jobs:
  R-CMD-check:
    runs-on: ${{ matrix.config.os }}

    name: ${{ matrix.config.os }} (${{ matrix.config.r }})

    strategy:
      fail-fast: false
      matrix:
        config:
          - {os: macOS-latest,    r: 'release'}
          - {os: windows-latest,  r: 'release'}
          - {os: windows-latest,  r: '3.6'}
          - {os: ubuntu-latest,   r: 'devel', http-user-agent: 'release'}
          - {os: ubuntu-latest,   r: 'release'}
          - {os: ubuntu-latest,   r: 'oldrel-1'}
          - {os: ubuntu-latest,   r: 'oldrel-2'}

    env:
      GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
      R_KEEP_PKG_SOURCE: yes

    steps:
      - uses: actions/checkout@v3

      - uses: r-lib/actions/setup-pandoc@v2

      - uses: r-lib/actions/setup-r@v2
        with:
          r-version: ${{ matrix.config.r }}
          http-user-agent: ${{ matrix.config.http-user-agent }}
          use-public-rspm: true

      - uses: r-lib/actions/setup-r-dependencies@v2
        with:
          extra-packages: any::rcmdcheck
          needs: check

      - name: install miniconda / tensorflow
        run: |
          reticulate::install_miniconda()
          tensorflow::install_tensorflow()
          tensorflow::tf$constant("Hellow Tensorflow")
        shell: Rscript {0}

      - uses: r-lib/actions/check-r-package@v2

From this run log.

Run reticulate::install_miniconda()
  reticulate::install_miniconda()
  tensorflow::install_tensorflow()
  tensorflow::tf$constant("Hellow Tensorflow")
  shell: C:\R\bin\Rscript.EXE {0}
  env:
    GITHUB_PAT: ***
    R_KEEP_PKG_SOURCE: yes
    _R_INSTALL_TIME_PATCHES_: no
    R_LIBS_USER: D:\a\_temp\Library
    TZ: UTC
    _R_CHECK_SYSTEM_CLOCK_: FALSE
    NOT_CRAN: true
    RSPM: https://packagemanager.posit.co/cran/latest
    RENV_CONFIG_REPOS_OVERRIDE: https://packagemanager.posit.co/cran/latest
    R_LIBS_SITE: C:/R/site-library
    R_LIB_FOR_PAK: C:/R/site-library
* Downloading "https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe" ...
trying URL 'https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe'
Content type 'application/octet-stream' length 76708568 bytes (73.2 MB)
==================================================
downloaded 73.2 MB

* Installing Miniconda -- please wait a moment ...
Error: Error: miniconda installation failed [exit code 2]
Execution halted
Error: Process completed with exit code 1.
t-kalinowski commented 1 year ago

Thanks for reporting, I'll investigate on Monday.

If you need a quick fix, a bare install_tensorflow() call should just work now, the underlying routines will find a suitable python in the runner tool cache automatically, and create a virtualenv with it that the R package will automatically find.

AshesITR commented 1 year ago

Thanks for the swift reply. I can live without testing on Windows R 3.6 for the moment.

t-kalinowski commented 1 year ago

I'm having some difficulty reproducing this locally - this error seems to be confined to some interaction between GHA and the older version of R.

Sidenote - with the most recent pair of TF and reticulate releases, conda as an installation method is now opt-in. A bare call like install_tensorflow() will create a virtual environment.

Removing the install_miniconda() call (or wrapping it in a try()) should allow the rest of the action steps to finish successfully.