I have been trying to set up IDL-Python bridge in
Linux environment. I have used the Python bridge on the Windows system. The
bridge has been constructed successfully and I used it several times. Based on
this experience, I tried to set up the Python bridge in Linux system(Ubuntu
14.04 LTS). After the constructing IDL-Python bridge, IDL can read the library
of Python 2.7. When I tried to import 'scipy' of the Python using IDL, It shows
that
IDL> python.import(‘scipy’)
IDL>
It did not shows any problems. However, when I
tried to read the function in IDL library in Python, I faced a error.
>>> from idlpy import IDL
Traceback (most recent call last):
File “”, line 1, in
File “/opt/IDL85/exelis/idl85/lib/bridges/idlpy.py”,
line 19, in
pyidl = __import__(idllibrary)
ImportError:
/opt/IDL85/exelis/idl85/bin/bin.linux.x86_64/pythonidl27.so: undefined symbol:
PyUnicodeUCS4_AsUTF8String
>>>
I searched about the 'PyUnicodeUCS4_AsUTF8String'
error and found that the Python 2.7 can read the UCS-2 or UCS-4. This error
massage seems to be appeared when the Python try to read a code with wrong
UCS-2/UCS-4. Unfortunately, I didn't know about UCS-2 and UCS-4, thus I
couldn't find the solution.
One weird thing that I found is that: I have used
same Python 2.7 in Windows and Linux system. In Windows system, Python 2.7 is
compiled with UCS-2 and I can use the Python bridge without any problems.
Python 2.7 in Linux system is also compiled with UCS-2. After that I knew about
it, I thought that the 'idlpy.py' code in Linux system is written in different
UCS-2/UCS-4. However, there is no difference between 'idlpy.py' code in Linux system
and Windows system. I think that the 'pythonidl27.so' is the problem in my
system. Is there any way to use the IDL-Python bridge on Linux???
|