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.07k stars 2.93k forks source link

CrewAI error when running #790

Closed Romansyah78 closed 2 months ago

Romansyah78 commented 4 months ago

Hello,im new to python and now i want to create my first very basic AI Agents with 2 agents(searcher,writer). But when im done creating it and checking google if my code wrong or not. After i feel its fine then i run it,when im run it this many error came:

File "C:\Users\Path\Downloads\Documents\Agent AI\bitcoin.py", line 1, in <module> from crewai import Agent, Task, Crew, Process File "C:\Users\Path\AppData\Roaming\Python\Python312\site-packages\crewai\__init__.py", line 1, in <module> from crewai.agent import Agent File "C:\Users\Path\AppData\Roaming\Python\Python312\site-packages\crewai\agent.py", line 5, in <module> from langchain.agents.agent import RunnableAgent File "C:\Users\Path\AppData\Roaming\Python\Python312\site-packages\langchain\agents\__init__.py", line 34, in <module> from langchain_community.agent_toolkits import ( File "C:\Users\Path\AppData\Roaming\Python\Python312\site-packages\langchain_community\agent_toolkits\__init__.py", line 41, in __getattr__ module = importlib.import_module(_module_lookup[name]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python312\Lib\importlib\__init__.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Kastama\AppData\Roaming\Python\Python312\site-packages\langchain_community\agent_toolkits\json\base.py", line 6, in <module> from langchain_core.callbacks import BaseCallbackManager File "C:\Program Files\Python312\Lib\site-packages\langchain_core\callbacks\__init__.py", line 9, in <module> from langchain_core.callbacks.base import ( File "C:\Program Files\Python312\Lib\site-packages\langchain_core\callbacks\base.py", line 7, in <module> from tenacity import RetryCallState File "C:\Program Files\Python312\Lib\site-packages\tenacity\__init__.py", line 653, in <module> from tenacity.asyncio import AsyncRetrying # noqa:E402,I100 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ModuleNotFoundError: No module named 'tenacity.asyncio'

*Im using python 3.12 btw

I dont know why this error show because i alrd installed all tool needed for AI Agents from crewai of course,but this error still happen. I will appreciate ppl who can answer and solved this problem because i want atleast create 1 successfull project with AI.

Romansyah78 commented 4 months ago

@saqib727 i alrd try install tenacity but when im import tenacity.asyncio its said module is not avaible

Btw this is my code:

`from crewai import Agent, Task, Crew, Process from langchain_openai import ChatOpenAI import os import tenacity

os.environ["OPENAI_API_KEY"] = "##########"

searcher = Agent( role="Bitcoin Info Searcher", goal="Search Information About Bitcoin", backstory="You're crypto trader who buy bitcoin when the price is low and sell it when the price is high" "You collect information about bitcoin price and the market cap of bitcoin" "You also work with a writer to make an article about bitcoin", verbose=True, allow_delegation=False ,
)

writer = Agent( role="Bitcoin Article Writer", goal="Write an accurate facts about Bitcoin" "Opinion piece about future Bitcoin price", backstory="You're a writer who work together with an searcher to create the best articel about bitcoin and post the articel on your blog" "you have 10 years experience become a writer and people know your article is good", verbose=True, allow_delegation=True,
)

search = Task( description=( "You're prioritizing to the latest bitcoin info and worthy news for bitcoin trader" "Make sure to create article thgat will uefull for bitcoin trader and the people who want to buy bitcoin" ), expected_output="A great article that easy to understand for beginner trader with a paragraph why we should buy/not buy bitcoin now.", agent=searcher, )

write = Task( description =( "Write any information from searcher about bitcoin" "Ensure the article is structured with an engaging introduction, insightful body, and a summarizing conclusion" "Proofread for grammatical errors" ), expected_output="A well-written article and ready to blog post with a minimal 3-4 paragraphs.", agent=writer, )

crew = Crew( agents=[searcher,writer], tasks=[search,write], verbose=2, process=Process.sequential )

result = crew.kickoff

print("########") print(result)`

Romansyah78 commented 4 months ago

@saqib727 I go to the code directory and running it from here using cmd. Btw can i know what python version do you have?

github-actions[bot] commented 2 months 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.

github-actions[bot] commented 2 months ago

This issue was closed because it has been stalled for 5 days with no activity.