Troubleshooting (Python)
How the native library is found
Section titled “How the native library is found”Mesmo(lib_path=None) resolves libmesmo.dylib / libmesmo.so / libmesmo.dll in this order:
- The explicit
lib_pathconstructor argument (a directory). - The
MESMO_LIB_PATHenvironment variable (a directory) — the usual way to run against a locally built library. - A copy bundled inside the installed wheel (
mesmo/_libs/) — this is what a normalpip installuses. - The bare filename, letting the OS loader search its default paths.
On Windows, the library’s directory is registered with os.add_dll_directory so sibling DLL dependencies resolve.
Common errors
Section titled “Common errors”OSError loading the library
Section titled “OSError loading the library”The library file wasn’t found or couldn’t be loaded.
- Wheel install: make sure you installed a wheel built for your platform (check
pip show -f cardano-client-liblistsmesmo/_libs/libmesmo...). A source install has no bundled library — setMESMO_LIB_PATH. - Local build: set
MESMO_LIB_PATHto the directory containing the library, and make the OS loader happy for its transitive dependencies:Terminal window export MESMO_LIB_PATH=/path/to/core/build/native/nativeCompileexport DYLD_LIBRARY_PATH=$MESMO_LIB_PATH # macOSexport LD_LIBRARY_PATH=$MESMO_LIB_PATH # Linux - Unsupported platform (macOS Intel): no prebuilt library exists — build from source (below).
RuntimeError: ... incompatible ... (version mismatch)
Section titled “RuntimeError: ... incompatible ... (version mismatch)”The wrapper and the native library must match on base semver. This appears when MESMO_LIB_PATH points at a stale build. Rebuild the library, or (at your own risk) set MESMO_SKIP_VERSION_CHECK=1.
MesmoClosedError
Section titled “MesmoClosedError”Something called the instance after close() (or after its with block ended). This exception is the wrapper saving you: handing a stale isolate handle to the native side would abort the whole interpreter. Keep calls inside the instance’s lifetime, or create a new Mesmo.
TypeError / ValueError about network
Section titled “TypeError / ValueError about network”The network argument is required and validated — there is no default (a silent mainnet default was removed deliberately). Pass Network.MAINNET or Network.TESTNET.
Mesmo error -10: ... from quicktx.build
Section titled “Mesmo error -10: ... from quicktx.build”MESMO_ERROR_TX_BUILD — the TxPlan didn’t build. Usual causes:
- Malformed YAML or a wrong intent field name (check against the TxPlan reference).
- A Plutus transaction with wrong/missing execution units.
Mesmo error -8(INSUFFICIENT_FUNDS) means the supplied UTXOs can’t cover outputs + fee.
tx.from_json / plutus.data_to_json / plutus.data_from_json fail
Section titled “tx.from_json / plutus.data_to_json / plutus.data_from_json fail”Known limitation of the current native library (GraalVM reflection configuration gaps). Use the working alternatives: a managed account’s sign_tx for signing, plutus.data_hash for datum hashing.
Building the native library from source
Section titled “Building the native library from source”Needed only on platforms without a prebuilt library (macOS Intel) or for development against Mesmo itself:
git clone https://github.com/bloxbean/mesmocd mesmosdk install java 25.0.3-graal # GraalVM with native-image./gradlew :core:nativeCompile # → core/build/native/nativeCompile/libmesmo.*export PYTHONPATH=$PWD/wrappers/pythonexport MESMO_LIB_PATH=$PWD/core/build/native/nativeCompilePlatform support
Section titled “Platform support”| Platform | Prebuilt | Notes |
|---|---|---|
| Linux x86_64 (glibc ≥ 2.17) | ✅ | RHEL/CentOS 7+, Ubuntu 18.04+, Debian 9+, Amazon Linux 2, … |
| Linux aarch64 (glibc ≥ 2.17) | ✅ | |
| macOS Apple Silicon | ✅ | |
| macOS Intel | ❌ | Oracle GraalVM dropped Intel Macs |
| Windows x86_64 | ✅ |
Alpine/musl: the musl native library exists (the Go/Rust/JS wrappers use it), but musllinux wheel publishing is still being wired up — on Alpine, install from source with
MESMO_LIB_PATHpointing at the musllibmesmo.sofor now.