MetaGPT icon indicating copy to clipboard operation
MetaGPT copied to clipboard

When testing researcher.py, there is a BUG ModuleNotFoundError: No module named 'sparkai', hoping to have a big boss to solve the confusion

Open 1729256800 opened this issue 10 months ago • 2 comments

I have tried pip install sparkai, but this only results in missing sparkai.core That seems to be the main problem spark_api.py,but I use the moonshot

Traceback (most recent call last): File "D:\Code\python\pycharm\MetaGPT\metagpt\roles\researcher.py", line 13, in from metagpt.actions import Action, CollectLinks, ConductResearch, WebBrowseAndSummarize File "D:\Code\python\pycharm\MetaGPT\metagpt\actions_init_.py", line 10, in from metagpt.actions.action import Action File "D:\Code\python\pycharm\MetaGPT\metagpt\actions\action.py", line 15, in from metagpt.actions.action_node import ActionNode File "D:\Code\python\pycharm\MetaGPT\metagpt\actions\action_node.py", line 22, in from metagpt.llm import BaseLLM File "D:\Code\python\pycharm\MetaGPT\metagpt\llm.py", line 11, in from metagpt.context import Context File "D:\Code\python\pycharm\MetaGPT\metagpt\context.py", line 16, in from metagpt.provider.base_llm import BaseLLM File "D:\Code\python\pycharm\MetaGPT\metagpt\provider_init_.py", line 16, in from metagpt.provider.spark_api import SparkLLM File "D:\Code\python\pycharm\MetaGPT\metagpt\provider\spark_api.py", line 4, in from sparkai.core.messages import _convert_to_message, convert_to_messages ModuleNotFoundError: No module named 'sparkai'

1729256800 avatar Feb 17 '25 13:02 1729256800

找到问题了是包没安装对,可以参考requirement.txt文件,还得更改一下安装路径字数上限

1729256800 avatar Feb 18 '25 07:02 1729256800

This issue has no activity in the past 30 days. Please comment on the issue if you have anything to add.

github-actions[bot] avatar Mar 21 '25 00:03 github-actions[bot]

This issue was closed due to 45 days of inactivity. If you feel this issue is still relevant, please reopen the issue to continue the discussion.

github-actions[bot] avatar Apr 04 '25 00:04 github-actions[bot]