Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

Python.Load

Loads the Python library.

Component Version macOS Windows Linux Server iOS SDK
Python 14.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "Python.Load"; Path )   More

Parameters

Parameter Description Example
Path The file path to the python library.
Pass name of .so file on Linux, DLL file on Windows or dylib for macOS.
For macOS also you can pass path of framework.
"python312.so"

Result

Returns OK or error.

Description

Loads the Python library.
You may need to check what version you have as the paths usually contain version numbers.

e.g.
MacOS:/opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework
Windows:C:\Users\cs\AppData\Local\Programs\Python\Python312\python312.dll
Linux:libpython3.11.so

On Windows you may need to call Process.SetDllDirectory function to tell Windows where to find dependencies for the python DLL.

On Linux if you get the error wrong ELF class: ELFCLASS32 if you try to load a 32-bit library into a 64-bit application. You may also get errors about version GLIBC_2.25 or similar if your libc library on the Linux installation isn't new enough for the loaded library.

Examples

Load library on Linux:

Set Variable [ $r ; Value: MBS("Python.Load"; "/usr/lib/aarch64-linux-gnu/libpython3.10.so.1.0") ]

Load library on Windows:

Set Variable [ $r ; Value: MBS( "Python.Load"; "C:\Program Files\Python310\python310.dll" ) ]

Load library on macOS with homebrew:

Set Variable [ $r ; Value: MBS( "Python.Load"; "/opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework" ) ]

See also

Example Databases

Blog Entries

This function checks for a license.

Created 23th May 2024, last changed 17th February 2026


Python.List - Python.Loaded