crewAIInc / crewAI

Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks.
https://crewai.com
MIT License
21.6k stars 3k forks source link

[BUG] protobuf discrepancy between CrewAI and crewai-tools #1395

Open rcl-code opened 1 month ago

rcl-code commented 1 month ago

Description

While running the crewai command from the terminal, I encountered a TypeError that suggests the descriptors cannot be created directly. The error message indicates that the issue may be due to outdated generated code, which needs to be regenerated with protoc version 3.19.0 or higher.

The error occurred when importing the OTLPSpanExporter from opentelemetry.exporter.otlp.proto.http.trace_exporter. The traceback suggests that the error originates from the google.protobuf.descriptor module, which is used by the opentelemetry.proto.common.v1.common_pb2 module.

The exact error message is as follows:

TypeError: Descriptors cannot be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

This issue prevents the use of the crewai command and potentially affects other parts of the system that rely on the same protobuf package or protoc compiler.

Note: I believe the issue comes when installing the crewai-tools from source (main branch at 04/10/2024). There is a different protobuf version installed in that version of crewai-tools. Observation: Current version on GitHub is 0.65.2 while the official pypi version is 0.67.1. Why the discrepancy ?

Steps to Reproduce

  1. Create conda env with python 3.11 and activate it
  2. Install crewai from source (tag:0.65.2) using poetry install
  3. Install crewai-tools (main at 04/10/2024) using poetry install
  4. Execute crewai -v

Expected behavior

Help pannel of crewai, something like this:

Usage: crewai [OPTIONS] COMMAND [ARGS]...

  Top-level command group for crewai.

Options:
  --help  Show this message and exit.

Commands:
  create             Create a new crew, pipeline, or flow.
  deploy             Deploy the Crew CLI group.
  flow               Flow related commands.
  install            Install the Crew.
  log-tasks-outputs  Retrieve your latest crew.kickoff() task outputs.
  login              Sign Up/Login to CrewAI+.
  replay             Replay the crew execution from a specific task.
  reset-memories     Reset the crew memories (long, short, entity,...
  run                Run the Crew.
  signup             Sign Up/Login to CrewAI+.
  test               Test the crew and evaluate the results.
  tool               Tool Repository related commands.
  train              Train the crew.
  version            Show the installed version of crewai.

Screenshots/Code snippets

image

Operating System

Ubuntu 20.04

Python Version

3.11

crewAI Version

0.65.2

crewAI Tools Version

0.12.1

Virtual Environment

Conda

Evidence

TypeError: Descriptors cannot be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

Possible Solution

None

Additional context

N/A

github-actions[bot] commented 3 weeks ago

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.