Github actions workflow option for a project using reticulate and python dependencies

Hi. I've locally (and via a few colleagues' computers, I think all macOS thus far) tested a package that requires reticulate and 2 python libraries and I was hoping to get those tests included on github in preparation to submit to CRAN. I'm getting different errors for different operating systems, but if there could be a general yaml for github workflows using reticulate that would be great. I also tried travis-ci but the examples for that seemed worse.

https://github.com/griff-rees/py2Rgraphs/actions/runs/693339267

A general summary of the issues: on linux there's no local python install, for macOS there's a permission error, and on Windows there's no installed python (and it seems to target python 2.7 rather than the minimum 3.6 as I specify in the DESCRIPTION). Any advice appreciated. Also: there are warnings on my attempt to use a 3 clause BSD licence but I think that's separate.

Linux error

Error: Error: package or namespace load failed for ‘py2Rgraphs’:
 .onLoad failed in loadNamespace() for 'py2Rgraphs', details:
  call: NULL
  error: could not find a Python environment for /usr/bin/python3

macOS error

NotWritableError: The current user does not have write permissions to a required path.
  path: /usr/local/miniconda/pkgs/cache/b89cf7bf.json
  uid: 501
  gid: 20

Windows error (seems to default to python 2.7 while this package requires python >=3.7)

Error: Error: package or namespace load failed for 'py2Rgraphs':
 .onLoad failed in loadNamespace() for 'py2Rgraphs', details:
  call: NULL
  error: could not find a Python environment for C:/hostedtoolcache/windows/Python/2.7.18/x86/python.exe

Thanks very much!

Have just found this, will try some of these modifications: https://github.com/rstudio/reticulate/blob/master/.github/workflows/R-CMD-check.yaml

I've added one of the main differences between the reticulate yaml and mine for linux testing but that hasn't fixed the problem.

The error message may imply that conda is a solution but I don't know if that could help windows and macOS builds.

Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
#
# To activate this environment, use
#
#     $ conda activate r-reticulate
#
# To deactivate an active environment, use
#
#     $ conda deactivate

Error: Error: package or namespace load failed for ‘py2Rgraphs’:
 .onLoad failed in loadNamespace() for 'py2Rgraphs', details:
  call: NULL
  error: could not find a Python environment for /usr/bin/python3
Error: Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/runner/work/py2Rgraphs/py2Rgraphs/check/py2Rgraphs.Rcheck/py2Rgraphs’

1 error ✖ | 0 warnings ✔ | 1 note ✖

This topic was automatically closed after 45 days. New replies are no longer allowed.


If you have a query related to it or one of the replies, start a new topic and refer back with a link.