{"record":{"id":"dc15144c41b9ec29","repo":"pola-rs/polars","slug":"no-dynamic-library-found-at-path-path","errorCode":null,"errorMessage":"no dynamic library found at path: {path}","messagePattern":"no dynamic library found at path: (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/plugins.py","lineNumber":137,"sourceCode":"    # https://docs.rs/serde-pickle/latest/serde_pickle/\n    return pickle.dumps(kwargs, protocol=5)\n\n\n@lru_cache(maxsize=16)\ndef _resolve_plugin_path(path: Path | str, *, use_abs_path: bool = False) -> Path:\n    \"\"\"Get the file path of the dynamic library file.\"\"\"\n    if not isinstance(path, Path):\n        path = Path(path)\n\n    if path.is_file():\n        return _resolve_file_path(path, use_abs_path=use_abs_path)\n\n    for p in path.iterdir():\n        if _is_dynamic_lib(p):\n            return _resolve_file_path(p, use_abs_path=use_abs_path)\n\n    msg = f\"no dynamic library found at path: {path}\"\n    raise FileNotFoundError(msg)\n\n\ndef _is_dynamic_lib(path: Path) -> bool:\n    return path.is_file() and path.suffix in (\".so\", \".dll\", \".pyd\")\n\n\ndef _resolve_file_path(path: Path, *, use_abs_path: bool = False) -> Path:\n    venv_path = Path(sys.prefix)\n\n    if use_abs_path:\n        return path.resolve()\n    else:\n        try:\n            file_path = path.relative_to(venv_path)\n        except ValueError:  # Fallback\n            file_path = path.resolve()\n\n    return file_path","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/py-polars/src/polars/plugins.py#L119-L155","documentation":"Plugin resolution failure in _resolve_plugin_path: the given path is not itself a file and scanning its directory yields no file that looks like a shared/dynamic library, so register_plugin_function cannot load anything from that location. Usually a wrong path or a directory without the compiled .so/.dylib/.dll.","triggerScenarios":"Calling lf.register_plugin(path=...) with a directory containing no .so/.dll/.pyd files, or a wrong/typo'd path to a plugin binary.","commonSituations":"Rust plugin not compiled yet (cargo build not run); pointing at the source directory instead of target/release or target/debug; cross-platform extension mismatch.","solutions":["Build the plugin first (cargo build --release) and point path at the built library or its directory","Verify the path exists and contains a file with suffix .so, .dll, or .pyd","Point directly at the .so file if you know its exact name"],"exampleFix":"// before\nlf.register_plugin(path=\"myplugin/\")  # empty dir\n// after\nlf.register_plugin(path=\"myplugin/target/release/libmyplugin.so\")","handlingStrategy":"validation","validationCode":"from pathlib import Path\np = Path(plugin_path)\nif not (p.is_file() and p.suffix in ('.so', '.dll', '.pyd')) and not any(f.suffix in ('.so', '.dll', '.pyd') for f in p.iterdir()):\n    raise FileNotFoundError(f\"no dynamic library at {p}\")","typeGuard":null,"tryCatchPattern":"try:\n    lf.register_plugin(path=plugin_path)\nexcept FileNotFoundError:\n    subprocess.run([\"cargo\", \"build\", \"--release\"], cwd=plugin_dir)","preventionTips":["Build the Rust plugin before registering it","Point at target/release or the .so file, not the source dir","Check for the platform-correct extension (.so on Linux, .dll on Windows)"],"tags":["python","polars","plugin","file-not-found"],"backgroundTag":"file-not-found","analyzedSha":"fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e","analyzedAt":"2026-09-18T22:14:11.667Z","contentChangedAt":"2026-09-18T22:14:11.667Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}