Article
· Sep 2 2m read

configuration of Flexible Python Runtime Feature in IRIS 2024.2

Hello Community,

This article aims to walk you through the process of setting up and utilizing the Flexible Python Runtime Feature for embedded Python. Prior to version 2024.2, Intersystems IRIS installer included a preinstalled version of Python, You can find the Python libraries and application files located in the \lib\python directory within your IRIS installation folder (for example, C:\InterSystems\IRIS20242\lib\python).

However, starting with version 2024.2, the IRIS installer no longer includes Python installation by default. Consequently, you will not find these files in the aforementioned directory. It is necessary for you to install the required version of Python to effectively work with embedded Python in IRIS.

Let's proceed to configure the flexible runtime feature within my IRIS environment.

I've installed the community version 2024.2 on my machine and I tried to connect the python shell immediately in IRIS terminal.

USER>Write $ZV
IRIS for Windows (x86-64) 2024.2 (Build 247U) Tue Jul 16 2024 09:57:03 EDT
USER>Do $SYSTEM.Python.Shell()
ERROR #5002: ObjectScript error: <OBJECT DISPATCH>Shell+16^%SYS.Python.1 *Failed to Load Python: Check documentation and messages.log, Check CPF parameters:[PythonRuntimeLibrary,PythonRuntimeLibraryVersion], Check sys.path setup in: $INSTANCE/lib/python/iris_site.py.

It throws an error because of missing configuration of PythonRuntimeLibrary and PythonRuntimeLibraryVersion values are empty( note: I already set the PythonRuntimeLibraryVersion version )

Now. I’ve already installed the python 3.12.5 in my system and configure the values in the settings.

PythonRuntimeLibrary  - “C:\Program Files\Python312\python3.dll”
PythonRuntimeLibraryVersion - 3.12

Once it’s configured. I executed the Do $SYSTEM.Python.Shell() again and it successfully get in to the python shell

 

Note: Flexible python runtime feature documentation and as per the documentation. This feature is not supported for all operating system

Discussion (5)4
Log in or sign up to continue

Hi @Ashok Kumar
I still get the same error after editing both PythonRuntimeLibrary and PyhtonRuntimeLibraryVersion. 

He's the situtation:
Windows 11 x64
Installed 2024.1 first, then upgraded to 2024.3 developer preview version
C:\InterSystems\IRIS\lib\python\ folder is present with 9 files. (From the original 2024.1 installation) 
I then installed Python 3.13 and let the installer add the system path variable
set PythonRuntimeLibrary - C:\Program Files\Python313\python3.dll (also tried C:\Program Files\Python313\python313.dll)
PythonRuntimeLibraryVersion - 3.13

I tried renaming the lib\python\ folder to see if anything changed but no luck
\mgr\python is empty

when running python from windows itself, it works as expected

Restarted both IRIS and the whole machine couple of times while testing. 

Any ideas? 
Thanks