From fb21ccb50ea6a322365e39d6bd882c6e74c2909e Mon Sep 17 00:00:00 2001 From: yihuang Date: Wed, 23 Apr 2025 10:37:40 +0800 Subject: [PATCH] feat: use sys.executable instead of python on PATH --- src/fastmcp/client/transports.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fastmcp/client/transports.py b/src/fastmcp/client/transports.py index 68544512a..210286bf2 100644 --- a/src/fastmcp/client/transports.py +++ b/src/fastmcp/client/transports.py @@ -3,6 +3,7 @@ import contextlib import datetime import os import shutil +import sys from collections.abc import AsyncIterator from pathlib import Path from typing import ( @@ -185,7 +186,7 @@ class PythonStdioTransport(StdioTransport): args: list[str] | None = None, env: dict[str, str] | None = None, cwd: str | None = None, - python_cmd: str = "python", + python_cmd: str = sys.executable, ): """ Initialize a Python transport.