前提・実現したいこと
あるpythonファイルをlaunchctlコマンドを使って30秒ごとに実行したですが、以下のエラーが出ます。
発生している問題・エラーメッセージ
Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pyautogui/_pyautogui_osx.py", line 5, in <module> import Quartz File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/Quartz/__init__.py", line 6, in <module> import AppKit File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/AppKit/__init__.py", line 10, in <module> import Foundation File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/Foundation/__init__.py", line 9, in <module> import CoreFoundation File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/CoreFoundation/__init__.py", line 9, in <module> import objc File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/objc/__init__.py", line 6, in <module> from . import _objc ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/objc/_objc.cpython-39-darwin.so, 0x0002): tried: '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/objc/_objc.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/lib/_objc.cpython-39-darwin.so' (no such file) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/hogehoge/Documents/python/lesson_start.py", line 4, in <module> import pyautogui as pgui File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pyautogui/__init__.py", line 544, in <module> from . import _pyautogui_osx as platformModule File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pyautogui/_pyautogui_osx.py", line 7, in <module> assert False, "You must first install pyobjc-core and pyobjc: https://pyautogui.readthedocs.io/en/latest/install.html" AssertionError: You must first install pyobjc-core and pyobjc: https://pyautogui.readthedocs.io/en/latest/install.html
該当のソースコード
xml
1<?xml version="1.0" encoding="UTF-8"?> 2<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 3<plist version="1.0"> 4<dict> 5 <key>Label</key> 6 <string>lesson_start</string> 7 8 <key>ProgramArguments</key> 9 <array> 10 <string>/usr/local/bin/python3</string> 11 <string>/Users/hogehoge/Documents/python/lesson_start.py</string> 12 </array> 13 14 <key>StartInterval</key> 15 <integer>30</integer> 16 17 <key>StandardOutPath</key> 18 <string>/Users/hogehoge/Documents/python/launchctl_log/lesson_start.out</string> 19 20 <key>StandardErrorPath</key> 21 <string>/Users/hogehoge/Documents/python/launchctl_log/lesson_start.err</string> 22</dict> 23</plist> 24
これはどうやって解決できるでしょうか?