(module: str, library: str)
return pkg_resources.resource_filename(module, os.path.join('lib', library))
Attempt to find a native library without using pkg_resources, and only fall back to pkg_resources upon failures.
    This is because "import pkg_resources" is slow.

    :return:    The full path of the native library.
Attempt to find a native library without using pkg_resources, and only fall back to pkg_resources upon failures.
    This is because "import pkg_resources" is slow.
Attempt to find a native library without using pkg_resources and only fall back to pkg_resources upon failures . This is because import pkg_resources is slow .
def _locate_lib(module: str, library: str) -> str:
    """
    Attempt to find a native library without using pkg_resources, and only fall back to pkg_resources upon failures.
    This is because "import pkg_resources" is slow.

    :return:    The full path of the native library.
    """
    base_dir = os.path.join(os.path.dirname(__file__), "..")
    attempt = os.path.join(base_dir, library)
    if os.path.isfile(attempt):
        return attempt

    import pkg_resources  # pylint:disable=import-outside-toplevel
    return pkg_resources.resource_filename(module, os.path.join('lib', library))
def _locate_lib ( module : str , library : str ) -> str : base_dir = os . path . join ( os . path . dirname ( __file__ ) , ".." ) attempt = os . path . join ( base_dir , library ) if os . path . isfile ( attempt ) : return attempt import pkg_resources # pylint:disable=import-outside-toplevel return pkg_resources . resource_filename ( module , os . path . join ( 'lib' , library ) )