IDL/General

Mac OS 및 Linux용 IDL 9.2에서 내장 파이썬 사용 이슈

이상우_IDL 2025. 8. 18. 13:15
728x90

얼마전에 출시된 IDL 9.2에 관한 게시물을 통하여 이제 IDL 9.2 버전부터는 파이썬(Python)이 내장된다는 것을 알려드린 바 있습니다. 저도 일단 윈도우즈용 IDL 9.2에서 이 기능을 사용해보고 있는 중입니다. 그런데 Mac OS 및 Linux용 IDL 9.2에서는 내장 파이썬을 사용하는데 있어서 몇가지 문제점들이 있다는 것이 확인되었습니다(2025년 8월 14일 현재 기준). 일단 확인된 이슈들은 두 종류입니다.
 
첫번째 이슈는 먼저 내장 파이썬에 탑재된 라이브러리들 중 일부가 정상적으로 작동하지 않는 현상입니다. 그 증상을 보면 다음과 같이 특정한 라이브러리를 불러올 때 에러가 발생합니다.
 
IDL> pd = python.import('pandas')
% Python is embedded version 3.13.
% Loaded DLM: PYTHON313.
% PYTHON_INIT: /Applications/NV5/idl92/bin/bin.darwin.x86_64/idl-python313.
% PYTHON_RUN: Exception: No module named 'pandas._libs.pandas_parser'.
% Execution halted at: PYTHON::RUN       418 /Applications/NV5/idl92/lib/bridges/python__define.pro
%                      PYTHON::IMPORT    223 /Applications/NV5/idl92/lib/bridges/python__define.pro
%                      $MAIN$          
 
위의 내용은 pandas 라이브러리를 불러올 때 에러가 발생하는 현상인데요. 현재 확인된 바로는 numpy, urllib3, wheel 등과 같은 대다수의 라이브러리들은 이러한 문제가 없지만 몇몇 라이브러리들(pandas, regex, h5py 등)에 한하여 위와 같은 현상이 발생합니다.
 
그리고 두번째 이슈는 새로운 라이브러리의 설치가 안되는 현상입니다. 예를 들어서 matplotlib 라이브러리를 새로 설치하기 위하여 pyutils.pipinstall 명령을 사용하는 경우를 보면, 제가 테스트해본 결과는 다음과 같습니다.
 
IDL> pyutils.pipinstall, 'matplotlib'
% Looking in indexes: https://pypi.python.org/simple
% Could not fetch URL https://pypi.python.org/simple/matplotlib/: There was a problem confirming the ssl certificate:
   HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /simple/matplotlib/ (Caused by SSLError("Can't connect
   to HTTPS URL because the SSL module is not available.")) - skipping
% Could not fetch URL https://pypi.python.org/simple/pip/: There was a problem confirming the ssl certificate:
   HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to
   HTTPS URL because the SSL module is not available.")) - skipping
 
이러한 현상은 matplotlib 뿐 아니라 다른 새로운 라이브러리들(예를 들면 tensorflow, beautifulsoup4 등)을 새로 설치하고자 할 경우에도 마찬가지로 발생합니다.
 
그래서 본사인 NV5 Geospatial 기술진에 문의해본 결과 Mac OS 및 Linux용 IDL 9.2에 한하여 이러한 이슈가 발생하는 것이 맞으며 조만간 수정될 예정이라고 합니다. 따라서 문제가 수정될 때까지는 Mac OS 및 Linux용 IDL 9.2에서 내장 파이썬을 사용하는데 있어서 위와 같은 이슈들이 있다는 것을 인지해두는 것이 좋을 것 같습니다. 하지만 당장 Mac OS 및 Linux용 IDL 9.2에서 파이썬을 사용하고자 할 경우에는 유저의 PC에 파이썬을 별도로 설치하고 이를 IDL과 연동시켜서 마치 내장 파이썬인 것처럼 사용하는 방법이 있습니다. 그 방법은 다음과 같습니다. 다만 영문으로 되어 있는 점 양해 부탁드립니다.
 
Ensure that your Python executable is on the system PATH environment variable. IDL will use the first Python executable that it finds. If you use a virtual environment such as Anaconda, then the correct Python should automatically be on your path after you activate it. If you are using your own Python installation then you may need to add Python to your system path.

On macOS, the final step is to run the setup.py install script for the IDL Python bridge. Using the Mac terminal shell, navigate to the <IDL_DIR>/lib/bridges directory and then run the script.

For example:

cd /Applications/<install dir>/idlxx/lib/bridges
python setup.py
idl
IDL> PyUtils.Load, 'python313'  ; start your flavor of Python
This script will install a symbolic link in your IDL bin directory that points to the correct Python library.

Note: Be sure that you run setup.py using the same Python that you wish to use for the IDL Python bridge.

Note: Depending on the installation location and who installed IDL, you might need to run the setup.py script as a "super-user" (sudo). If the script fails with an error about permissions, either re-run the script using these elevated privileges or contact your System Administrator and have them run the script.
 
이와 같은 방법이 있습니다. 물론 윈도우즈용 IDL 9.2에서는 내장 파이썬을 사용하는데 있어서 위와 같은 이슈들이 발생하지 않으며 정상적인 사용이 가능합니다. 따라서 내장 파이썬을 정상적으로 사용하기 위해서는 당분간은 윈도우즈용 IDL 9.2를 사용하는 것도 대안이 될 수 있겠지만, 어쨌든 Mac OS 및 Linux용 IDL 9.2에서 내장 파이썬을 정상적으로 사용하기 위해서는 앞서 언급한 문제들이 수정될 때까지 좀 기다려야 할 것 같습니다. 아무래도 IDL에 파이썬이 내장되는 것이 이번이 처음이어서 약간의 시행착오가 있는 것 같은데 차차 해결될 것으로 기대합니다. 이 문제와 관련하여 향후 수정 및 업데이트가 있게 되면 다시 알려드리도록 하겠습니다.
 
 
* 이 글이 도움이 되었다면 게시물에 대하여 공감 버튼(하트 모양) 클릭 및 블로그 구독도 해주시면 더 큰 힘이 됩니다. 감사합니다.

LIST

'IDL > General' 카테고리의 다른 글

IDL 9.2 출시  (2) 2025.08.05
과거 게시물들에 대한 재정비  (2) 2025.05.28
IDL 관련 Q&A 방법 정리  (0) 2024.11.22
IDL 9.1 출시  (2) 2024.10.04
IDL 관련 주요 웹 링크 정리 (2024년 6월 현재)  (1) 2024.06.05