This is a pre-release version (2.5.0.dev0+git20251130.2de293a). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy 2.5.0.dev0+git20251130.2de293a / numpy / ctypeslib / load_library

function

numpy.ctypeslib:load_library

source: build-install/usr/lib/python3.14/site-packages/numpy/ctypeslib/_ctypeslib.py :93

Signature

def   load_library ( libname loader_path )

Summary

It is possible to load a library using

Extended Summary

>>> lib = ctypes.cdll[<full_path_name>] # doctest: +SKIP

But there are cross-platform considerations, such as library file extensions, plus the fact Windows will just load the first library it finds with that name. NumPy supplies the load_library function as a convenience.

Parameters

libname : path-like

Name of the library, which can have 'lib' as a prefix, but without an extension.

loader_path : path-like

Where the library can be found.

Returns

ctypes.cdll[libpath] : library object

A ctypes library object

Raises

: OSError

If there is no library with the expected extension, or the library is defective and cannot be loaded.

Aliases

  • numpy.ctypeslib.load_library

Referenced by