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
19.34k stars 2.68k forks source link

from ._pydantic_core import ( ImportError: attempted relative import with no known parent package #231

Closed Big0boy closed 7 months ago

Big0boy commented 7 months ago

i have the crewai installed ! pip show crewai Name: crewai Version: 0.5.3 Summary: Cutting-edge framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks. Home-page: Author: Joao Moura Author-email: joao@crewai.com License: Location: Requires: langchain, langchain-openai, openai, pydantic Required-by Since it was showing there is a package missing , I attempted to install it and installed it ! pip show pydantic pydantic-core

Name: pydantic Version: 2.5.3 Summary: Data validation using Python type hints Home-page: Author: Author-email: Samuel Colvin s@muelcolvin.com, Eric Jolibois em.jolibois@gmail.com, Hasan Ramezani hasan.r67@gmail.com, Adrian Garcia Badaracco 1755071+adriangb@users.noreply.github.com, Terrence Dorsey terry@pydantic.dev, David Montague david@pydantic.dev, Serge Matveenko lig@countzero.co, Marcelo Trylesinski marcelotryle@gmail.com, Sydney Runkle sydneymarierunkle@gmail.com, David Hewitt mail@davidhewitt.io License: Location:
Requires: annotated-types, pydantic-core, typing-extensions Required-by: crewai, langchain, langchain-core, langsmith, openai, palm

Name: pydantic_core Version: 2.14.6 Summary: Home-page: https://github.com/pydantic/pydantic-core Author: Author-email: Samuel Colvin s@muelcolvin.com License: MIT Location: Requires: typing-extensions Required-by: pydantic

Then i did some digging and found this specific import line in the pydantic_core is causing some issue from ._pydantic_core import ( ArgsKwargs, MultiHostUrl, PydanticCustomError, PydanticKnownError, PydanticOmit, PydanticSerializationError, PydanticSerializationUnexpectedValue, PydanticUndefined, PydanticUndefinedType, PydanticUseDefault, SchemaError, SchemaSerializer, SchemaValidator, Some, TzInfo, Url, ValidationError, __version__, from_json, to_json, to_jsonable_python, validate_core_schema, )

joaomdmoura commented 7 months ago

Nice catch, doing some digging on this one

joaomdmoura commented 7 months ago

is there a specific scenario you get this error though? It's not something I have encountered so far

Big0boy commented 7 months ago

is there a specific scenario you get this error though? It's not something I have encountered so far

It started after i upgrade the crewai to 0.5.3 Side note : I am using Gemini so that must be why not many people have not encountered this issue

Source code (just the example code with Gemini api)

Python version: 3.11.8

joaomdmoura commented 7 months ago

Okay, I'll try to replicate it tomorrow

Big0boy commented 7 months ago

Don't know how but I was able to resolve the problem, It may be a problem of not the correct version of package When I ran it inside a conda virtual environment it worked