2

I am trying to build and deploy this bookdown project with GitHub Actions. One of the chapters uses the keras R package, which means I need to install Conda (or set up a virtual environment). At the end of the Miniconda installation command, there is an error when trying to collect metadata.

2020-06-24T04:47:59.7495480Z * Miniconda has been successfully installed at '/Users/runner/Library/r-miniconda'.
2020-06-24T04:47:59.7496060Z [1] "/Users/runner/Library/r-miniconda"
2020-06-24T04:48:00.3909040Z * Project '~/runners/2.263.0/work/drake/drake' loaded. [renv 0.10.0]
2020-06-24T04:48:00.7964920Z * The project and lockfile are out of sync -- use `renv::status()` for more details.
2020-06-24T04:48:00.7968340Z Warning message:
2020-06-24T04:48:00.7969190Z Project requested R version '3.6.0' but '4.0.1' is currently being used 
2020-06-24T04:48:05.2408080Z Collecting package metadata (current_repodata.json): ...working... failed
2020-06-24T04:48:05.2410390Z 
2020-06-24T04:48:05.2410820Z NotWritableError: The current user does not have write permissions to a required path.
2020-06-24T04:48:05.2411080Z   path: /usr/local/miniconda/pkgs/cache/b89cf7bf.json
2020-06-24T04:48:05.2411230Z   uid: 501
2020-06-24T04:48:05.2411350Z   gid: 20
2020-06-24T04:48:05.2411430Z 
2020-06-24T04:48:05.2411690Z If you feel that permissions on this path are set incorrectly, you can manually
2020-06-24T04:48:05.2411940Z change them by executing
2020-06-24T04:48:05.2412010Z 
2020-06-24T04:48:05.2412260Z   $ sudo chown 501:20 /usr/local/miniconda/pkgs/cache/b89cf7bf.json
2020-06-24T04:48:05.2412330Z 
2020-06-24T04:48:05.2413470Z In general, it's not advisable to use 'sudo conda'.
2020-06-24T04:48:05.2413570Z 
2020-06-24T04:48:05.2414250Z 
2020-06-24T04:48:05.2886400Z ##[error]Error: Error 1 occurred creating conda environment r-reticulate
2020-06-24T04:48:05.2890770Z Execution halted
2020-06-24T04:48:05.3050700Z ##[error]Process completed with exit code 1.

The full job log is here.

landau
  • 5,636
  • 1
  • 22
  • 50

1 Answers1

0

Depending on how R is set up, this post might be helpful for you. You might need to configure the .Renviron file.

Unable to change python path in reticulate (R)

Bryan Butler
  • 1,750
  • 1
  • 19
  • 19
  • Good idea. I tried setting `RETICULATE_PYTHON` to `"/Users/runner/Library/r-miniconda/bin/python3"`, but the build still failed with the same error: . – landau Jun 30 '20 at 21:24
  • Are all of your main libraries in the miniconda environment? – Bryan Butler Jun 30 '20 at 21:28
  • I'm not sure. Miniconda seems pretty self-contained, and the GitHub Actions workflow installs a fresh copy each time. But Actions images apparently have their own python3 installations. I wouldn't expect this to conflict, but maybe it does. Somehow it's trying to write to `/usr/local/miniconda/pkgs/cache/b89cf7bf.json` even though the fresh miniconda lives at `/Users/runner/Library/r-miniconda`. – landau Jun 30 '20 at 21:49