From d84766c356842221efbd6b3dc78267f88e6ba97a Mon Sep 17 00:00:00 2001 From: Eduardo Chiarotti Date: Fri, 11 Oct 2024 22:02:17 -0300 Subject: [PATCH] fix: message --- src/crewai/cli/run_crew.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/crewai/cli/run_crew.py b/src/crewai/cli/run_crew.py index 7cf8fccf7..0b1ac29bc 100644 --- a/src/crewai/cli/run_crew.py +++ b/src/crewai/cli/run_crew.py @@ -1,6 +1,7 @@ import subprocess import click +import tomllib def run_crew() -> None: @@ -9,15 +10,16 @@ def run_crew() -> None: """ command = ["uv", "run", "run_crew"] try: - subprocess.run( - command, capture_output=False, text=True, check=True, stderr=subprocess.PIPE - ) + subprocess.run(command, capture_output=False, text=True, check=True) except subprocess.CalledProcessError as e: click.echo(f"An error occurred while running the crew: {e}", err=True) click.echo(e.output, err=True, nl=True) - click.echo(e.stderr, err=True, nl=True) - if "table found" in e.stderr: + + with open("pyproject.toml", "rb") as f: + data = tomllib.load(f) + + if data.get("tool", {}).get("poetry"): click.secho( "It's possible that you are using an old version of crewAI that uses poetry, please run `crewai update` to update your pyproject.toml to use uv.", fg="yellow",