diff --git a/libs/cli/langgraph_cli/cli.py b/libs/cli/langgraph_cli/cli.py index 9c11c4b10..98d585f40 100644 --- a/libs/cli/langgraph_cli/cli.py +++ b/libs/cli/langgraph_cli/cli.py @@ -575,6 +575,13 @@ def dev( try: from langgraph_api.cli import run_server except ImportError: + py_version_msg = "" + if sys.version_info < (3, 11): + py_version_msg = ( + "\n\nNote: The in-mem server requires Python 3.11 or higher to be installed." + f" You are currently using Python {sys.version_info.major}.{sys.version_info.minor}." + ' Please upgrade your Python version before installing "langgraph-cli[inmem]".' + ) try: from importlib import util @@ -582,16 +589,19 @@ def dev( raise click.UsageError( "Required package 'langgraph-api' is not installed.\n" "Please install it with:\n\n" - ' pip install -U "langgraph-cli[inmem]"\n\n' + ' pip install -U "langgraph-cli[inmem]"' + f"{py_version_msg}" ) from None except ImportError: raise click.UsageError( "Could not verify package installation. Please ensure Python is up to date and\n" "langgraph-cli is installed with the 'inmem' extra: pip install -U \"langgraph-cli[inmem]\"" + f"{py_version_msg}" ) from None raise click.UsageError( "Could not import run_server. This likely means your installation is incomplete.\n" "Please ensure langgraph-cli is installed with the 'inmem' extra: pip install -U \"langgraph-cli[inmem]\"" + f"{py_version_msg}" ) from None config_json = langgraph_cli.config.validate_config_file(pathlib.Path(config)) diff --git a/libs/cli/pyproject.toml b/libs/cli/pyproject.toml index 7e166ee25..6595cc7b9 100644 --- a/libs/cli/pyproject.toml +++ b/libs/cli/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "langgraph-cli" -version = "0.1.66" +version = "0.1.67" description = "CLI for interacting with LangGraph API" authors = [] license = "MIT" diff --git a/libs/cli/tests/unit_tests/test_config.py b/libs/cli/tests/unit_tests/test_config.py index 6bbc12aab..27aea10bd 100644 --- a/libs/cli/tests/unit_tests/test_config.py +++ b/libs/cli/tests/unit_tests/test_config.py @@ -91,10 +91,22 @@ def test_validate_config(): validate_config({"python_version": "3.10"}) assert "Minimum required version" in str(exc_info.value) - config = validate_config({"python_version": "3.11-bullseye", "dependencies": ["."], "graphs": {"agent": "./agent.py:graph"}}) + config = validate_config( + { + "python_version": "3.11-bullseye", + "dependencies": ["."], + "graphs": {"agent": "./agent.py:graph"}, + } + ) assert config["python_version"] == "3.11-bullseye" - config = validate_config({"python_version": "3.12-slim", "dependencies": ["."], "graphs": {"agent": "./agent.py:graph"}}) + config = validate_config( + { + "python_version": "3.12-slim", + "dependencies": ["."], + "graphs": {"agent": "./agent.py:graph"}, + } + ) assert config["python_version"] == "3.12-slim"