0 环境准备
- ollama已部署推理模型qwen:7b(deepseek目前不支持function calling)
- 已安装miniconda环境
- 具备科学上网条件
1 OpenManus安装
1.1 下载OpenManus源码包
https://github.com/mannaandpoem/OpenManus/archive/refs/heads/main.zip
1.2 复制配置文件
解压下载的源码后,讲config目录下面的config.example-model-ollama.toml复制一份,命名为config.toml
cp .\config\config.example-model-ollama.toml .\config\config.toml
1.3 修改配置文件
windows环境下使用notepad命令打开配置文件,此处以windows环境为例,linux环境可以使用vim打开配置文件。
notepad .\config\config.toml
修改成qwen2.5:7b模型,如下图:
# Global LLM configuration
[llm] #OLLAMA:
api_type = 'ollama'
model = "qwen2.5:7b" # The LLM model to use
base_url = "http://localhost:11434/v1" # API endpoint URL
api_key = "ollama" # Your API key
max_tokens = 8192 # Maximum number of tokens in the response
temperature = 0.0 # Controls randomness
2 python环境准备
建议使用conda创建python。
2.1 创建python环境
conda create -n open_manus python=3.12
2.2 激活python环境
conda activate open_manus
2.3 安装依赖包
进入解压后的openmanus目录,安装openmanus需要的安装包。
pip install -r requirements.txt
等待安装完成。
3 运行openmanus
执行main.py脚本
python .\main.py
4 测试效果
4.1 此处问的是武汉的天气,如下图:
4.2 可以看到openmanus需要执行的步骤以及执行的进度
4.3 openmanus编写抓取天气脚本
附录
问题-运行脚本错误
File "E:\dev\conda\envs\open_manus\Lib\asyncio\windows_utils.py", line 102, in fileno
raise ValueError("I/O operation on closed pipe")
ValueError: I/O operation on closed pipe
openmanus编写的脚本基于linux环境编写的。在windows环境下执行会报错,建议在linux环境下安装openmanus。