4211
Using the IDL-Python Bridge on Linux
There is now a service pack available which fixes some naming conflicts between IDL and some Python modules on Linux. It is strongly recommended that you download IDL 8.5.1 to fix this problem.
The purpose of this help article is to have a collection of the different versions of Python that have been tested on Linux. This article also lists the environment variables that have been set to get different versions of Python to work or a comment mentioning that the IDL-Python bridge does not work.The basic environment variables that have been set can be found here:
http://www.harrisgeospatial./docs/Python.html
NOTE: You may need to change the paths in the environment variables depending upon where you installed Python and IDL. Additionally, not all variations of Python may work with IDL. This is because Python is open source and there is a chance that each Python package is built differently and there may be other built in differences for each distribution that cause incompatibilities with IDL. These examples are meant as a general guideline to get the IDL-Python bridge to work and it may require some troubleshooting before it successfully works.
Also note that these instances of the IDL-Python bridge were set up using the bash shell in terminal. The default location that these variables need to be added is ~/.bashrc. If you want to use the c-shell you can place similar variables in the ~/.cshrc file. The environment variables will need to be changed for using the c-shell and you cannot copy/paste these into your .cshrc file and expect them to work.
Default Python 2.7 for Linux
Because Python can already be called from a terminal window, you just need to make additions to your environment so that Python can find IDL and the IDL dlls. Here are the additional variables that should be set in ~/.bashrc:
export PYTHONPATH="/usrl/local/exelis/idl85/bin/bin.linux.x86_64:/usr/local/exelis/idl85/lib/bridges"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/exelis/idl85/bin/bin.linux.x86_64"
NOTE: You may also need to make an additional change to your Python installation if IDL is crashing when you try to initialize the IDL-Python bridge. To do this you will need to modify the contents of a dlm file so that Python can find the symbols it needs. For Python 2.7 this file is idl_python.dlm and can be found under the directory /usr/local/exelis/idl85/bin/bin.linux.x86_64. You need to replace the line which starts with CHECKSUM and change the entire line to "GLOBAL_SYMBOLS" without the quotes. The line that starts with CHECKSUM is just before the first line which says FUNCTION.
Anaconda with Python 2.7
The IDL-Python bridge works for IDL with the Anaconda distribution that uses Python 2.7. However, there are some issues surrounding this bridge. There are some naming conflicts in IDL that prohibit matplotlib.pyplot from being loaded into IDL when calling Python from IDL. However it is possible to call IDL from within Python without a problem. Here are the environment variables that were set in ~/.bashrc
export PATH="/home/tech_support/python/anaconda/bin:$PATH"
export PYTHONHOME="/home/tech_support/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"
Anaconda with Python 3.4
The IDL-Python bridge works for IDL with the Anaconda distribution that uses Python 3.4. However, there is the same naming conflict in IDL that prohibit matplotlib.pyplot from being loaded into IDL when calling Python from IDL. However it is possible to call IDL from within Python without a problem. Here are the environment variables that were set in ~/.bashrc
export PATH="/home/tech_support/python/anaconda3/bin:$PATH"
export PYTHONHOME="/home/tech_support/python/anaconda3"
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/anaconda3/lib:/usr/local/exelis/idl85/bin/bin.linux.x86_64"
reviewed 9/2015 zn, kk