Skip to content

Github Actions running reticulate with Python 3.8.12 fails to create venv #1712

@pbulsink

Description

@pbulsink

Reticulate in Github Actions seems to be failing to create a venv when Python 3.12.8 is used.

Using the prescribed Github Action for setup r-reticulate produces the following error:


      - name: setup r-reticulate venv
        shell: Rscript {0}
        run: |
              python_packages <- c("numpy", "fastf1")
              
              library(reticulate)
              virtualenv_create("r-reticulate", Sys.which("python"))
              virtualenv_install("r-reticulate", python_packages)
              
              path_to_python <- virtualenv_python("r-reticulate")
              writeLines(sprintf("RETICULATE_PYTHON=%s", path_to_python),
                         Sys.getenv("GITHUB_ENV"))

output:

  shell: /usr/local/bin/Rscript {0}
  env:
    GITHUB_PAT: ***
    R_KEEP_PKG_SOURCE: yes
    R_LIBS_USER: /home/runner/work/_temp/Library
    TZ: UTC
    _R_CHECK_SYSTEM_CLOCK_: FALSE
    NOT_CRAN: true
    RSPM: https://packagemanager.posit.co/cran/__linux__/noble/latest
    RENV_CONFIG_REPOS_OVERRIDE: https://packagemanager.posit.co/cran/__linux__/noble/latest
    pythonLocation: /opt/hostedtoolcache/Python/3.12.8/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.12.8/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.8/x64
    Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.8/x64
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.8/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.8/x64/lib
    R_LIB_FOR_PAK: /opt/R/4.4.2/lib/R/site-library
Error in stop_no_virtualenv_starter(version = version, python = python) : 
  Suitable Python installation for creating a venv not found.
  Requested Python: /opt/hostedtoolcache/Python/3.12.8/x64/bin/python
Please install Python with one of following methods:
- https://github.com/rstudio/python-builds/
- reticulate::install_python(version = '<version>')
Calls: virtualenv_create ... check_can_be_virtualenv_starter -> stop_no_virtualenv_starter
Execution halted

First noticed in Scasanova/f1dataR weekly checks: https://github.com/SCasanova/f1dataR/actions/runs/12344927770/job/34448193501. Previous weekly check passed, no code was checked in during the week. The only change was the release of Python 3.12.8 and use of that version by actions/setup-python@v5.

Also visible in reticulate's own R-CMD-Check test actions: https://github.com/rstudio/reticulate/actions/runs/12770139964/job/35594285240.

I apologize, I don't have a device on which I can test this locally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions