From 8e9851e1749d076e0a6be39f121ab3d4f7a1762e Mon Sep 17 00:00:00 2001 From: Eugene Yurtsev Date: Mon, 8 Jan 2024 14:47:13 -0500 Subject: [PATCH] x --- libs/core/langchain_core/sys_info.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/core/langchain_core/sys_info.py b/libs/core/langchain_core/sys_info.py index 40eb3b050d0cf..c4ffd798614c9 100644 --- a/libs/core/langchain_core/sys_info.py +++ b/libs/core/langchain_core/sys_info.py @@ -4,9 +4,9 @@ def print_sys_info(*, additional_pkgs: Sequence[str] = tuple()) -> None: """Print information about the environment for debugging purposes.""" - import importlib import platform import sys + from importlib import metadata, util packages = [ "langchain_core", @@ -34,7 +34,7 @@ def print_sys_info(*, additional_pkgs: Sequence[str] = tuple()) -> None: for pkg in packages: try: - found_package = importlib.util.find_spec(pkg) + found_package = util.find_spec(pkg) except Exception: found_package = None if found_package is None: @@ -43,7 +43,7 @@ def print_sys_info(*, additional_pkgs: Sequence[str] = tuple()) -> None: # Package version try: - package_version = importlib.metadata.version(pkg) + package_version = metadata.version(pkg) except Exception: package_version = None