diff --git a/src/crewai/cli/run_crew.py b/src/crewai/cli/run_crew.py index 2d246cb0d..338f44e01 100644 --- a/src/crewai/cli/run_crew.py +++ b/src/crewai/cli/run_crew.py @@ -8,20 +8,17 @@ def run_crew() -> None: Run the crew by running a command in the UV environment. """ command = ["uv", "run", "run_crew"] - try: - result = subprocess.run(command, capture_output=False, text=True, check=True) - - if result.stderr: - click.echo(result.stderr, err=True) + subprocess.run(command, capture_output=True, 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.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", - ) + if "table found" in e.stderr: + 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", + ) except Exception as e: click.echo(f"An unexpected error occurred: {e}", err=True)