Skip to content

R package installation fails with error in tfio/R/experimental_wrappers.R:59 #2152

@s-elsheikh

Description

@s-elsheikh

Hi,
thanks for your efforts in saving R users the effort and creating this R package for tfio.

I tried to install it today, but there seemed to be a syntax error

to reproduce:
I created a fresh conda env,
installed tensorflow[and-cuda]==2.16.2
installed tensorfloe_io

then ran this code in R:

  1. set conda env
  2. check python version
  3. check tfio installation and version
  4. install R package

this is a reprex of the output:

reticulate::use_condaenv("tfio_env")
reticulate::py_run_string("import sys; print(sys.version)")
#> 3.9.23 (main, Jun 5 2025, 13:49:45)
#> [GCC 11.2.0]
reticulate::py_run_string("import sys; print(sys.version_info)")
#> sys.version_info(major=3, minor=9, micro=23, releaselevel='final', serial=0)
reticulate::py_run_string("import tensorflow_io as tfio; print(tfio.version)")
#> 0.37.1
remotes::install_github("tensorflow/io", subdir = "R-package")
#> Downloading GitHub repo tensorflow/io@HEAD
#>
#> ── R CMD build ─────────────────────────────────────────────────────────────────
#> /bin/bash: /home/samer/anaconda3/envs/tfio_env/lib/libtinfo.so.6: no version information available (required by /bin/bash)
#> * checking for file ‘/tmp/RtmpwFGsvO/remotes377e4456b5b3/tensorflow-io-e42be7b/R-package/DESCRIPTION’ ... OK
#> * preparing ‘tfio’:
#> * checking DESCRIPTION meta-information ... OK
#> * checking for LF line-endings in source and make files and shell scripts
#> * checking for empty or unneeded directories
#> Removed empty directory ‘tfio/docs’
#> Omitted ‘LazyData’ from DESCRIPTION
#> * building ‘tfio_0.4.1.tar.gz’
#> Installing package into '/home/samer/R/x86_64-pc-linux-gnu-library/4.5'
#> (as 'lib' is unspecified)
#> Warning in i.p(...): installation of package
#> '/tmp/RtmpwFGsvO/file377e7036adec/tfio_0.4.1.tar.gz' had non-zero exit status

the above output did not capture the error:

Error in parse(...) :
/tmp/RtmpfsHKb8/R.INSTALL33a2443e04d8/tfio/R/experimental_wrappers.R:59:23: unexpected 'function'
58: #' @export
59: IODataset <- function(function
^
ERROR: unable to collate and parse R files for package ‘tfio’

  • removing ‘/home/samer/R/x86_64-pc-linux-gnu-library/4.5/tfio’

Thanks a lot

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