diff --git a/setup.py b/setup.py index ee22169f4..3e52dcc20 100644 --- a/setup.py +++ b/setup.py @@ -23,6 +23,7 @@ "protobuf==4.25.0", "expiringdict", "dill", + "psutil", ] service_requires = [ diff --git a/src/agentscope/server/servicer.py b/src/agentscope/server/servicer.py index 42bf3b3f9..156d4bbf4 100644 --- a/src/agentscope/server/servicer.py +++ b/src/agentscope/server/servicer.py @@ -6,10 +6,10 @@ import json from concurrent import futures from loguru import logger -import psutil try: import dill + import psutil import grpc from grpc import ServicerContext from google.protobuf.empty_pb2 import Empty @@ -20,6 +20,7 @@ from agentscope.utils.tools import ImportErrorReporter dill = ImportErrorReporter(import_error, "distribute") + psutil = ImportErrorReporter(import_error, "distribute") grpc = ImportErrorReporter(import_error, "distribute") Empty = ImportErrorReporter( # type: ignore[misc] import_error,