crewAIInc / crewAIInc/crewAI

crewai run shows raw uv spawn error when run outside a CrewAI project

Open
#6,305 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
58.8k
Forks
8.5k
Avg merge
1d 15h
Merged PRs (30d)
109

Description

Summary

Running crewai run from a directory with a pyproject.toml that is not a CrewAI crew or flow project falls through to uv run run_crew. Because that script is not defined, uv reports a low-level spawn failure:

error: Failed to spawn: `run_crew`
  Caused by: No such file or directory (os error 2)
An error occurred while running the crew: Command '['uv', 'run', 'run_crew']' returned non-zero exit status 2.

Reproduction

  1. Be in a parent repository or another Python project directory that has pyproject.toml but no [project.scripts].run_crew entry.
  2. Run crewai run.

This commonly happens after creating a CrewAI project in a subdirectory and accidentally running from the parent directory instead of the generated crew directory.

Expected behavior

The CLI should fail before invoking uv and explain that the current directory is not a runnable CrewAI crew or flow project, with guidance to run from the project directory or add the expected script.

Actual behavior

The CLI invokes uv anyway, so users see a raw spawn error for run_crew or kickoff instead of actionable CrewAI guidance.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in a directory with a pyproject.toml but no [project.scripts].run_crew entry, then trace the crewai run CLI path that invokes uv. Ensure invalid CrewAI project directories are rejected before uv with guidance to use the project directory or add the expected script, and verify the raw spawn error no longer appears.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.