diff --git a/modules/terminal_ops/python.py b/modules/terminal_ops/python.py index d9a7f538..74de26b8 100644 --- a/modules/terminal_ops/python.py +++ b/modules/terminal_ops/python.py @@ -64,22 +64,6 @@ class PythonMixin: return self._detect_system_python() - @staticmethod - def _derive_pip_from_python(python_path: str) -> str: - """ - 根据 python 可执行文件推导匹配的 pip,可避免“python 在 venv、pip 却指向系统”。 - 若同目录下找不到 pip3/pip,则回退为 ` -m pip`。 - """ - try: - bin_dir = Path(python_path).resolve().parent - for name in ("pip3", "pip"): - cand = bin_dir / name - if cand.exists() and os.access(cand, os.X_OK): - return str(cand) - except Exception: - pass - return f"{python_path} -m pip" - def _detect_preinstalled_python(self) -> Optional[str]: """尝试定位预装虚拟环境的 python 可执行文件。""" # 允许显式指定可执行文件(优先级最高)