print_sys_info() — langchain Function Reference
Architecture documentation for the print_sys_info() function in sys_info.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD cdf45fc0_01da_db4a_bf5c_59e28cef0148["print_sys_info()"] 2bcdd6e0_75d4_11ae_f64b_12df138edcea["sys_info.py"] cdf45fc0_01da_db4a_bf5c_59e28cef0148 -->|defined in| 2bcdd6e0_75d4_11ae_f64b_12df138edcea 6135f8da_3d4d_2105_1559_21f716adf8b7["_get_sub_deps()"] cdf45fc0_01da_db4a_bf5c_59e28cef0148 -->|calls| 6135f8da_3d4d_2105_1559_21f716adf8b7 style cdf45fc0_01da_db4a_bf5c_59e28cef0148 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/langchain_core/sys_info.py lines 36–132
def print_sys_info(*, additional_pkgs: Sequence[str] = ()) -> None:
"""Print information about the environment for debugging purposes.
Args:
additional_pkgs: Additional packages to include in the output.
"""
# Packages that do not start with "langchain" prefix.
other_langchain_packages = [
"langserve",
"langsmith",
]
langchain_pkgs = [
name for _, name, _ in pkgutil.iter_modules() if name.startswith("langchain")
]
langgraph_pkgs = [
name for _, name, _ in pkgutil.iter_modules() if name.startswith("langgraph")
]
all_packages = sorted(
set(
langchain_pkgs
+ langgraph_pkgs
+ other_langchain_packages
+ list(additional_pkgs)
)
)
# Always surface these packages to the top
order_by = ["langchain_core", "langchain", "langchain_community", "langsmith"]
for pkg in reversed(order_by):
if pkg in all_packages:
all_packages.remove(pkg)
all_packages = [pkg, *list(all_packages)]
system_info = {
"OS": platform.system(),
"OS Version": platform.version(),
"Python Version": sys.version,
}
print()
print("System Information")
print("------------------")
print("> OS: ", system_info["OS"])
print("> OS Version: ", system_info["OS Version"])
print("> Python Version: ", system_info["Python Version"])
# Print out only langchain packages
print()
print("Package Information")
print("-------------------")
not_installed = []
for pkg in all_packages:
try:
found_package = util.find_spec(pkg)
except Exception:
found_package = None
if found_package is None:
not_installed.append(pkg)
continue
# Package version
try:
package_version = metadata.version(pkg)
except Exception:
package_version = None
# Print package with version
if package_version is not None:
print(f"> {pkg}: {package_version}")
if not_installed:
print()
print("Optional packages not installed")
print("-------------------------------")
for pkg in not_installed:
print(f"> {pkg}")
Domain
Subdomains
Defined In
Calls
Source
Frequently Asked Questions
What does print_sys_info() do?
print_sys_info() is a function in the langchain codebase, defined in libs/core/langchain_core/sys_info.py.
Where is print_sys_info() defined?
print_sys_info() is defined in libs/core/langchain_core/sys_info.py at line 36.
What does print_sys_info() call?
print_sys_info() calls 1 function(s): _get_sub_deps.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free