Symptom
import crewai takes more than 25 seconds before any other line runs. The linked issue does not give an error string.
Evidence what you'll see
- The report times it with
start = time.time()beforeimport crewai, thenprint(time.time() - start). - A comment on a faster machine measured later versions as slower, from
11.0sonv0.32.2up to18.4son master in that table. - The same comment measured about
10son Python 3.10, on Windows and on Ubuntu under WSL, and under a second on Colab.
Why it happens
Importing the package loaded large libraries immediately, so the cost was paid at import crewai even when the script had not called anything yet. Pull request #1396 refactors those imports to lazy-load the large libraries. The pull request says that cut import time from about 30 seconds to about 5 seconds.
Affected versions
crewAI 0.32.2 and crewai-tools 0.3.0, Windows 10, Python 3.12, venv. The comment's table shows the same cost on later versions through the master branch at that date.
Fix steps
0 of 2 done
Your check marks stay in this browser only.
How to check it worked
- Time
import crewaiagain with the report's timer. The pull request's result is about 5 seconds, against about 30 seconds before the change.
If it still fails
- Python 3.10 was faster in one comment and still took about 10 seconds. That comment is not the pull request.
- The linked issue does not name a release whose notes list pull request 1396.
Sources and credit
Summarized in our own words from these public reports. Credit goes to their authors.
Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change
Hit an error we don't cover? Submit it