crewai run shows raw uv spawn error when run outside a CrewAI project
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
- Be in a parent repository or another Python project directory that has
pyproject.tomlbut no[project.scripts].run_crewentry. - 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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