diff --git a/PythonKit/PythonLibrary.swift b/PythonKit/PythonLibrary.swift index 9cbd1a4..0d642bb 100644 --- a/PythonKit/PythonLibrary.swift +++ b/PythonKit/PythonLibrary.swift @@ -213,6 +213,12 @@ extension PythonLibrary { self.enforceNonLoadedPythonLibrary() PythonLibrary.Environment.library.set(path) } + + public static func libraryExists() -> Bool { + let pythonLibraryHandleTest = Self.loadPythonLibrary() + return Self.isPythonLibraryLoaded(at: pythonLibraryHandleTest) + } + } // `PythonVersion` struct that defines a given Python version.