Reticulate: 4 Byte Unicode (UCS4) Broken

Created on 10 Feb 2017  路  1Comment  路  Source: rstudio/reticulate

(Pardon my ignorance of both Python and C++, but...)

I installed reticulate on a Raspberry Pi (raspbian distro -- a debian variant) and when attempting to import I get the following:

> picamera <- import("picamera")
Error in py_initialize(config$python, config$libpython, config$pythonhome,  : 
  PyUnicodeUCS2_FromString - /usr/lib/python2.7/config-arm-linux-gnueabihf/libpython2.7.so: undefined symbol: PyUnicodeUCS2_FromString

It seems that the Python 2.7 that comes on this distro is compiled to use 4 byte unicode characters (UCS4, rather than UCS2)

When altering the constant in libpython.cpp (https://github.com/rstudio/reticulate/compare/master...trestletech:master) I'm then able to import successfully.

bug

Most helpful comment

Good catch! I think there's a way to work around this by calling the Python unicode function rather than the (apparently platform-dependent) C API.

>All comments

Good catch! I think there's a way to work around this by calling the Python unicode function rather than the (apparently platform-dependent) C API.

Was this page helpful?
0 / 5 - 0 ratings