pyreadr icon indicating copy to clipboard operation
pyreadr copied to clipboard

Error occurs only on Mac not Windows

Open EvoLandEco opened this issue 1 year ago • 1 comments

I try to use pyreadr to share data between R and Python in my own package. I basically write some matrices or vectors in R to rds files in the temp dir and then use pyreadr to read them in. My code worked fine on several windows machines but on the two Macs I tested, I got the following error:

brts_result = pyreadr.read_r(brts_file_path)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Luis/lib/python3.12/site-packages/pyreadr/pyreadr.py", line 66, in read_r
    parser.parse(filename_bytes)
  File "pyreadr/librdata.pyx", line 149, in pyreadr.librdata.Parser.parse
  File "pyreadr/librdata.pyx", line 178, in pyreadr.librdata.Parser.parse
pyreadr.custom_errors.LibrdataError: Invalid file, or file has unsupported features

The error occurs when using pyreadr.read_r to read the rds files. Attached please find one of the example rds in a zip file: BT_{tree_67}_{1}.zip

EvoLandEco avatar May 16 '24 10:05 EvoLandEco

thanks for the example file. I cannot reproduce the error, i.e. I can read the file in a mac computer. So I am not sure what is the issue here. Maybe try to read the rds file directly using pyreadr (instead of your package), if it works, then it means there is something going on in your package.

ofajardo avatar May 23 '24 13:05 ofajardo

Closed due to lack of activity. Reopen if needed.

ofajardo avatar Jul 02 '24 09:07 ofajardo