Skip to content
Home » Fixed: crewai 0.186.1 requires litellm==1.74.9, but you have litellm 1.77.1 which is incompatible.

Fixed: crewai 0.186.1 requires litellm==1.74.9, but you have litellm 1.77.1 which is incompatible.

This is a common dependency conflict. So, sometimes, when you successfully install crewAI, you may encounter problems when using it. To resolve this, you need to install the specific version of litellm that crewai requires.

The quickest solution is to downgrade your litellm package.

Bash

pip install litellm==1.74.9

Running this command will uninstall version 1.77.1 and install the required version 1.74.9.


Why This Happens

When you install a Python package like crewai, it has a list of other packages it depends on, sometimes with very specific version requirements. In this case, crewai version 0.186.1 was built and tested to work with litellm version 1.74.9 exactly. Using a newer version can lead to unexpected errors because of changes in the code.


Best Practice: Use a Virtual Environment 🌱

To avoid these issues in the future, it’s highly recommended to use a virtual environment for each of your projects. This creates an isolated space with its own set of installed packages, preventing conflicts between projects.

Here’s how to do it:

  1. Create a virtual environment:
    • Navigate to your project folder in the terminal.
    • Run the following command:
      Bash# For macOS/Linux python3 -m venv venv
      # For Windows python -m venv venv
  2. Activate the environment:
    • You must activate the environment each time you work on the project.
      Bash
      # For macOS/Linux source venv/bin/activate
      # For Windows .\venv\Scripts\activate
    • You’ll know it’s active when you see (venv) at the beginning of your terminal prompt.
  3. Install your packages:
    • Now, with the environment active, install crewai. Pip will automatically handle installing the correct dependencies, including litellm==1.74.9.
      Bash
      pip install crewai==0.186.1

Leave a Reply

error: Content is protected !!