Error occurs only on Mac not Windows
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
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.
Closed due to lack of activity. Reopen if needed.