Unable to install crewai

I have tried several times now to install and use crewai however I continue to get the same error:

   Traceback (most recent call last):
  File "/home/smc/.local/bin/crewai", line 5, in <module>
    from crewai.cli.cli import crewai
  File "/home/smc/.local/lib/python3.10/site-packages/crewai/cli/cli.py", line 21, in <module>
    from .run_crew import run_crew
  File "/home/smc/.local/lib/python3.10/site-packages/crewai/cli/run_crew.py", line 4, in <module>
    import tomllib
ModuleNotFoundError: No module named 'tomllib'

I have tried using Python versions 3.12, 3.11.8, and older. Can anyone help me get started?

How are you trying to install CrewAI? What command are you using?

I am using a conda environment with Python version 3.11.10. I am following the crewAI Get Started docs and have the following crewai versions:

crewai==0.86.0
crewai-tools==0.17.0

I finished the installation step and am following the QuickStart. When I try to run the command crewai create crew latest-ai-development I get the error I have listed above. Is there a step I am missing?

Hi @kitana, can you share the FULL error message you’re getting so we can troubleshoot further?

Yes, here is a full rundown of what I’ve done. Thank you for the assistance.

  1. Create a conda environment & checked the python version: Python 3.11.10

  2. Installed CrewAI per the installation steps listed in the docs, run pip freeze | grep crewai and received:

crewai==0.86.0
crewai-tools==0.17.0
  1. At this point there are no errors, until I attempt the Quickstart steps and try to built my first project with the command crewai create crew latest-ai-development

I then receive this output:

Traceback (most recent call last):
  File "/home/smc/.local/bin/crewai", line 5, in <module>
    from crewai.cli.cli import crewai
  File "/home/smc/.local/lib/python3.10/site-packages/crewai/cli/cli.py", line 21, in <module>
    from .run_crew import run_crew
  File "/home/smc/.local/lib/python3.10/site-packages/crewai/cli/run_crew.py", line 4, in <module>
    import tomllib
ModuleNotFoundError: No module named 'tomllib'Traceback (most recent call last):
  File "/home/smc/.local/bin/crewai", line 5, in <module>
    from crewai.cli.cli import crewai
  File "/home/smc/.local/lib/python3.10/site-packages/crewai/cli/cli.py", line 21, in <module>
    from .run_crew import run_crew
  File "/home/smc/.local/lib/python3.10/site-packages/crewai/cli/run_crew.py", line 4, in <module>
    import tomllib
ModuleNotFoundError: No module named 'tomllib'

@kitana, You said you installed Python 3.11 but I noticed your error shows that you’re using Python 3.10.

/home/smc/.local/lib/python3.10/site-packages/crewai/cli/cli.py

Are you using a virtual environment?

Yes I am, the virtual environment is Python v3.11.10

I had the same issue for ages! In the end was able to do it consistently and I posted what I did in this github repo. Maybe check out the Readme there GitHub - vin67/crewai_docker: CrewAI dockerfile template. Good luck!

I have tried for days on my Mac but at the end I gave up.

Can you use a different virtual environment other than conda?

python3 -m venv .venv && source .venv/bin/activate

then install crewai:

pip install crewai crewai-tools

then run the install:

crewai install

then run code:

crewai run

@Umberto_Arreghini, what issues have you run into?

also please share your system and the steps you’ve taken to run it.