Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

运行PC-Agent的时候遇到报错OSError: cannot open resource #84

Open
wenwend1122 opened this issue Jan 23, 2025 · 1 comment
Open

Comments

@wenwend1122
Copy link

Traceback (most recent call last):
File "D:\MobileAgent\PC-Agent\run.py", line 507, in
perception_infos, width, height = get_perception_infos(screenshot_file, screenshot_som_file, font_path=args.font_path)
File "D:\MobileAgent\PC-Agent\run.py", line 383, in get_perception_infos
draw_coordinates_boxes_on_image(screenshot_file, copy.deepcopy(merged_icon_coordinates), screenshot_som_file, font_path)
File "D:\MobileAgent\PC-Agent\run.py", line 69, in draw_coordinates_boxes_on_image
font = ImageFont.truetype(font_path, int(height * 0.012))
File "C:\ProgramData\anaconda3\envs\GUIagent\lib\site-packages\PIL\ImageFont.py", line 807, in truetype
return freetype(font)
File "C:\ProgramData\anaconda3\envs\GUIagent\lib\site-packages\PIL\ImageFont.py", line 804, in freetype
return FreeTypeFont(font, size, index, encoding, layout_engine)
File "C:\ProgramData\anaconda3\envs\GUIagent\lib\site-packages\PIL\ImageFont.py", line 244, in init
self.font = core.getfont(
OSError: cannot open resource

@auhowielau
Copy link
Collaborator

目前代码默认运行在macOS,不同OS字体路径不同,添加--pc_type='windows'后重试一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants