Closed NAMEKDSUN closed 2 days ago
这个是SciAgent所在的路径
明白,我看代码中存在导入agentscope所在的文件路径,但是依然报ImportError: cannot import name 'SciAgent' from 'agentscope.agents' (/home/ecs-user/anaconda3/envs/science/lib/python3.11/site-packages/agentscope/agents/init.py)
可以print一下sys.path吗
['/home/ecs-user/Social_Science/sci_platform', '/home/ecs-user/anaconda3/envs/science/lib/python311.zip', '/home/ecs-user/anaconda3/envs/science/lib/python3.11', '/home/ecs-user/anaconda3/envs/science/lib/python3.11/lib-dynload', '/home/ecs-user/anaconda3/envs/science/lib/python3.11/site-packages', '../agentscope-main/src']
根据报错显示他并没有去项目中的agentscope寻找SciAgent,而是从使用pip install的agentscope寻找SciAgent
找到了解决办法,不要使用pip install agentscope来进行安装,使用开发者模型进行安装agentscope:pip install -e . ref:https://github.com/modelscope/agentscope/blob/main/README.md
我看您修改文档了,使用pip install -e.安装agentscope,必须要把agentscope的readme文档放在agentscope-main目录下才可以
我们把setup.py里面这部分代码改掉了,尝试过可以正常安装
Traceback (most recent call last): File "/home/ecs-user/Social_Science/sci_platform/run.py", line 1, in
from sci_platform import Platform
File "/home/ecs-user/Social_Science/sci_platform/sci_platform.py", line 13, in
from agentscope.agents import SciAgent
ImportError: cannot import name 'SciAgent' from 'agentscope.agents' (/home/ecs-user/anaconda3/envs/science/lib/python3.11/site-packages/agentscope/agents/init.py)
运行run.py文件报错,没有办法从项目中的agentscope导入SciAgent