How to make basemap in matplotlib work in python build with UCS4

145 Views Asked by At

I just build python with UCS-4, everything is working great! except one: basemap in matplotlib. I am getting the following error while importing Basemap:

ImportError: .../python2.7/site-packages/mpl_toolkits/basemap/_proj.so: undefined symbol: PyUnicodeUCS2_DecodeUTF8

I am aware of this similar question and the answer did not help.

From my investigation, I think that problem comes from the library geos that is required by basemap and possibly from swig that is used to build python support for geos. However, I got out of hope when I read the following

At this time, SWIG provides limited support for Unicode and wide-character strings (the C wchar_t type). Some languages provide typemaps for wchar_t, but bear in mind these might not be portable across different operating systems. This is a delicate topic that is poorly understood by many programmers and not implemented in a consistent manner across languages. For those scripting languages that provide Unicode support, Unicode strings are often available in an 8-bit representation such as UTF-8 that can be mapped to the char * type (in which case the SWIG interface will probably work). If the program you are wrapping uses Unicode, there is no guarantee that Unicode characters in the target language will use the same internal representation (e.g., UCS-2 vs. UCS-4). You may need to write some special conversion functions.

on swig web site

Has anyone succeed in building matplotlib with basemap in python UCS-4?

0

There are 0 best solutions below