[geekan/MetaGPT]mac 运行程序失败

2024-05-16 168 views
0

hello,我使用的是mac m1的电脑,现在执行该程序,发现mac缺失mmdc命令,想问一下,后续会考虑兼容mac电脑吗? 异常如下: Traceback (most recent call last): File "/Users/ysc/Dev_Env/python/MetaGPT/startup.py", line 34, in fire.Fire(main) File "/Users/ysc/Library/Python/3.9/lib/python/site-packages/fire/core.py", line 141, in Fire component_trace = _Fire(component, args, parsed_flag_args, context, name) File "/Users/ysc/Library/Python/3.9/lib/python/site-packages/fire/core.py", line 475, in _Fire component, remaining_args = _CallAndUpdateTrace( File "/Users/ysc/Library/Python/3.9/lib/python/site-packages/fire/core.py", line 691, in _CallAndUpdateTrace component = fn(*varargs, kwargs) File "/Users/ysc/Dev_Env/python/MetaGPT/startup.py", line 30, in main asyncio.run(startup(idea, investment)) File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete return future.result() File "/Users/ysc/Dev_Env/python/MetaGPT/startup.py", line 20, in startup await company.run(n_round=n_round) File "/Users/ysc/Dev_Env/python/MetaGPT/metagpt/software_company.py", line 60, in run await self.environment.run() File "/Users/ysc/Dev_Env/python/MetaGPT/metagpt/environment.py", line 58, in run await asyncio.gather(futures) File "/Users/ysc/Dev_Env/python/MetaGPT/metagpt/roles/role.py", line 222, in run rsp = await self._react() File "/Users/ysc/Dev_Env/python/MetaGPT/metagpt/roles/role.py", line 193, in _react return await self._act() File "/Users/ysc/Dev_Env/python/MetaGPT/metagpt/roles/role.py", line 153, in _act response = await self._rc.todo.run(self._rc.important_memory) File "/Users/ysc/Dev_Env/python/MetaGPT/metagpt/actions/design_api.py", line 83, in run self._save(context, system_design) File "/Users/ysc/Dev_Env/python/MetaGPT/metagpt/actions/design_api.py", line 77, in _save self._save_prd(docs_path, resources_path, context[-1].content) File "/Users/ysc/Dev_Env/python/MetaGPT/metagpt/actions/design_api.py", line 58, in _save_prd mermaid_to_file(quadrant_chart, resources_path / 'competitive_analysis') File "/Users/ysc/Dev_Env/python/MetaGPT/metagpt/utils/common.py", line 129, in mermaid_to_file subprocess.run(['mmdc', '-i', str(tmp), '-o', output_file, '-w', str(width), '-H', str(height)]) File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/subprocess.py", line 505, in run with Popen(popenargs, kwargs) as process: File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/subprocess.py", line 951, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1821, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'mmdc'

回答

1

+1,要不跟作者说下基于docker部署吧,要不然环境都不一致

0

hello,我使用的是mac m1的电脑,现在执行该程序,发现mac缺失mmdc命令,想问一下,后续会考虑兼容mac电脑吗? 异常如下: Traceback (most recent call last): File "/Users/ysc/Dev_Env/python/MetaGPT/startup.py", line 34, in fire.Fire(main) File "/Users/ysc/Library/Python/3.9/lib/python/site-packages/fire/core.py", line 141, in Fire component_trace = _Fire(component, args, parsed_flag_args, context, name) File "/Users/ysc/Library/Python/3.9/lib/python/site-packages/fire/core.py", line 475, in _Fire component, remaining_args = _CallAndUpdateTrace( File "/Users/ysc/Library/Python/3.9/lib/python/site-packages/fire/core.py", line 691, in _CallAndUpdateTrace component = fn(*varargs, kwargs) File "/Users/ysc/Dev_Env/python/MetaGPT/startup.py", line 30, in main asyncio.run(startup(idea, investment)) File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete return future.result() File "/Users/ysc/Dev_Env/python/MetaGPT/startup.py", line 20, in startup await company.run(n_round=n_round) File "/Users/ysc/Dev_Env/python/MetaGPT/metagpt/software_company.py", line 60, in run await self.environment.run() File "/Users/ysc/Dev_Env/python/MetaGPT/metagpt/environment.py", line 58, in run await asyncio.gather(futures) File "/Users/ysc/Dev_Env/python/MetaGPT/metagpt/roles/role.py", line 222, in run rsp = await self._react() File "/Users/ysc/Dev_Env/python/MetaGPT/metagpt/roles/role.py", line 193, in _react return await self._act() File "/Users/ysc/Dev_Env/python/MetaGPT/metagpt/roles/role.py", line 153, in _act response = await self._rc.todo.run(self._rc.important_memory) File "/Users/ysc/Dev_Env/python/MetaGPT/metagpt/actions/design_api.py", line 83, in run self._save(context, system_design) File "/Users/ysc/Dev_Env/python/MetaGPT/metagpt/actions/design_api.py", line 77, in _save self._save_prd(docs_path, resources_path, context[-1].content) File "/Users/ysc/Dev_Env/python/MetaGPT/metagpt/actions/design_api.py", line 58, in _save_prd mermaid_to_file(quadrant_chart, resources_path / 'competitive_analysis') File "/Users/ysc/Dev_Env/python/MetaGPT/metagpt/utils/common.py", line 129, in mermaid_to_file subprocess.run(['mmdc', '-i', str(tmp), '-o', output_file, '-w', str(width), '-H', str(height)]) File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/subprocess.py", line 505, in run with Popen(popenargs, kwargs) as process: File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/subprocess.py", line 951, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1821, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'mmdc'

这个是因为setup.py中的npm安装没有成功,尝试独立执行:

sudo npm install -g @mermaid-js/mermaid-cli

1

@geekan 老哥,有群吗,我觉得这个项目后面肯定会火的,感觉是对大模型的另一种应用

1

@ysc972 有的。见首页最下方加群