X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 21 Nov 2016 06:07 PM by  anon
UCS2/UCS4 Problem for Python 2.7 bridge on Linux.
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
21 Nov 2016 06:07 PM
    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???

    Deleted User



    Basic Member


    Posts:143
    Basic Member


    --
    16 Dec 2016 11:12 AM
    We have had success using the IDL-Python bridge in Linux environment. One recommendation might be to use the Anaconda Python distribution. After you have installed Anaconda, you can set up the following environment variables and then launch IDL. From there you should be able to use the IDL-Python bridge. export PATH="/home/tech_support/python/anaconda/bin:$PATH" export PYTHONHOME="/home//python/anaconda" export PYTHONPATH="/usr/local/exelis/idl85/bin/bin.linux.x86_64:/usr/local/exelis/idl85/lib/bridges" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/tech_support/python/anaconda/lib:/usr/local/exelis/idl85/bin/bin.linux.x86_64 David Harris Geospatial Solutions
    You are not authorized to post a reply.