Written by

~~ retired but not tired ~~
MOD
Question Robert Cemper · Feb 3, 2025

Py fails in Win Terminal - fixed

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
02/03/25-18:27:39:497 (13156) 1 [Generic.Event] CPF settings (PythonRuntimeLibraryVersion) do not specify python correctly - Python can not be loaded
02/03/25-18:27:39:498 (13156) 1 [Generic.Event] CPF settings (PythonRuntimeLibrary) do not specify python correctly - Python can not be loaded

my iris.CPF just shows nothing. what is the correctly formatted content ?

^CONFIG("config","PythonPath")=""
^CONFIG("config","PythonRuntimeLibrary")=""
^CONFIG("config","PythonRuntimeLibraryVersion")=""

next from iris_site.py:

>>> print(get_win_python_install_dir())
C:\Program Files\Python313

>>> print( __sitegetsitepackages([get_win_python_install_dir()]))
['C:\\Program Files\\Python313', 'C:\\Program Files\\Python313\\Lib\\site-packages']

>>> print(sys.path)
['', 'C:\\Program Files\\Python313\\python313.zip', 'C:\\Program Files\\Python313\\DLLs', 'C:\\Program Files\\Python313\\Lib', 'C:\\Program Files\\Python313', 'C:\\Program Files\\Python313\\Lib\\site-packages']

Various attempts to set iris.CPF according to docs / examples manually failed
What else can I check?

PythonPath=C:\Program Files\Python313
PythonRuntimeLibrary=C:\Program Files\Python313\python3.dll
PythonRuntimeLibraryVersion=3.13

Also downgrade to Python 3.9.13 didn't improve anything.

Product version: IRIS 2024.3
$ZV: IRIS for Windows (x86-64) 2024.3 (Build 217U)

Comments

Vitaliy Serdtsev · Feb 4, 2025

Please note the following warning:

Important:

There are known incompatibilities between InterSystems IRIS and Python 3.13, so you are advised to avoid Python 3.13 at this time. This issue will be addressed in an upcoming version of InterSystems IRIS.

0
Robert Cemper  Feb 4, 2025 to Vitaliy Serdtsev

Thanks.  but 3.9.13  was no improvement.

0
Vitaliy Serdtsev  Feb 4, 2025 to Robert Cemper

I installed Python 3.12.8 (x64) and configured it according to the documentation (link is given above)

Everything is working fine:

USER><FONT COLOR="#0000ff">do $System</FONT><FONT COLOR="#008080">.Python</FONT><FONT COLOR="#000000">.</FONT><FONT COLOR="#0000ff">Shell</FONT><FONT COLOR="#000000">()</FONT>

Python 3.12.8 (tags/v3.12.8:2dc476b, Dec 3 2024, 19:30:04) [MSC v.1942 64 bit (AMD64)] on win32 Type quit() or Ctrl-D to exit this shell.

By the way, I didn't touch PythonPath.

0
Guillaume Rongier · Feb 4, 2025

can you give a try to https://github.com/grongierisc/iris-embedded-python-wrapper.

follow the readme, it will give you the instruction to work with venv and a chosen version of python and bind it to iris.

behind the scene, this module help to setup the PythonPath, PythonRuntimeLibray and PythonRuntimeLibrayVersion

let me know, if you find any issue.

Btw, it will not solve the python 3.13 issue, you need to upgrade to 2025.1 to support it.

0
Robert Cemper  Feb 4, 2025 to Guillaume Rongier

Merci,
As noted I'm back to python 3.9.13.  sys.path looks correct
the problem persists
message log shows:

(17064) 1 [Generic.Event] Python library failed to LoadLibraryEx :126 C:\Program Files\Python313\python3.dll

NTFS error 126 indicates also a problem in DLL registry.
I used an official 64bit installer. Probably Pre-WIn11 design.

0
Vitaliy Serdtsev  Feb 4, 2025 to Robert Cemper

I was interested and I decided to check:

USER><FONT COLOR="#0000ff">w $zv</FONT>
IRIS for Windows (x86-64) 2024.3 (Build 217U) Thu Nov 14 2024 17:59:58 EST
USER><FONT COLOR="#0000ff">d $System</FONT><FONT COLOR="#008080">.Python</FONT><FONT COLOR="#000000">.</FONT><FONT COLOR="#0000ff">Shell</FONT><FONT COLOR="#000000">()</FONT>

Python 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v.1929 64 bit (AMD64)] on win32 Type quit() or Ctrl-D to exit this shell.

0
Vitaliy Serdtsev  Feb 4, 2025 to Robert Cemper
C:\Program Files\Python313\python3.dll
Here is exactly the version 3.9.13, and not 3.13?
0
Robert Cemper · Feb 4, 2025

After un-install of my own python versions
PY was still there in a different hidden and protected version unknown for me.
I detected it using regedit 
C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.12_3.12.2288.0_x64__qbz5n2kfra8p0\ 
I fail to explain where it came from (pre-installed win ?? )
Manual killing it and reinstallation of an official Python distribution fixed it.
BIG THANKS for your advise and help- 

0