TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Crane04/esem/llms.txt
Use this file to discover all available pages before exploring further.
python() helper accepts either a file path to a local .py file or the name of a pip-installed package. When you pass a package name, the worker calls importlib.import_module() internally — the same mechanism Python itself uses for all standard imports. This means any package that works in a regular Python script will work through the bridge.
Importing an installed package
Pass the package name as a string instead of a file path:The package must already be installed in the Python interpreter that esem-bridge is using. If it is not installed, Python will raise a
ModuleNotFoundError which crosses the bridge as a PythonError.Using a virtualenv
By default the bridge spawnspython3 from your system PATH. Set the ESEM_PYTHON environment variable to point to any Python binary — including one inside a virtual environment — and the bridge will use that interpreter instead:
Using a conda environment
The sameESEM_PYTHON variable works for conda environments:
How module loading works
The Python worker decides how to load a module spec based on simple path detection:- If the spec starts with
./or/, or ends with.py→ loaded as a file path usingimportlib.util.spec_from_file_location - Otherwise → loaded as an installed package using
importlib.import_module()
"./tools.py", "/abs/path/tools.py", and "tools.py" are all treated as file paths, while "numpy", "sklearn", and "pandas" are treated as package names.