実現したいこと
pyautogui.locateCenterOnScreenを使用したい
前提
pyautogui.locateCenterOnScreenを使用したいが
PyAutoGUI was unable to import pyscreezeのエラーとなる
発生している問題・エラーメッセージ
----> 3 pyautogui.locateCenterOnScreen("icon.png") File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyautogui\__init__.py:228, in _couldNotImportPyScreeze(*unused_args, **unsed_kwargs) 223 def _couldNotImportPyScreeze(*unused_args, **unsed_kwargs): 224 """ 225 This function raises ``PyAutoGUIException``. It's used for the PyScreeze function names if the PyScreeze module 226 failed to be imported. 227 """ --> 228 raise PyAutoGUIException( 229 "PyAutoGUI was unable to import pyscreeze. (This is likely because you're running a version of Python that Pillow (which pyscreeze depends on) doesn't support currently.) Please install this module to enable the function you tried to call." 230 ) PyAutoGUIException: PyAutoGUI was unable to import pyscreeze. (This is likely because you're running a version of Python that Pillow (which pyscreeze depends on) doesn't support currently.) Please install this module to enable the function you tried to call.
該当のソースコード
python
1import pyautogui 2pyautogui.locateCenterOnScreen("icon.png")
試したこと
!pip listの結果は以下です。
Package Version
attrs 23.1.0
certifi 2023.5.7
cffi 1.15.1
cycler 0.11.0
EasyProcess 1.1
entrypoint2 1.1
exceptiongroup 1.1.2
fonttools 4.38.0
h11 0.14.0
idna 3.4
importlib-metadata 6.7.0
jpholiday 0.1.8
keyboard 0.13.5
kiwisolver 1.4.4
matplotlib 3.5.3
MouseInfo 0.1.3
mss 7.0.1
natsort 8.4.0
numpy 1.21.6
outcome 1.2.0
packaging 23.1
pandas 1.3.5
Pillow 9.5.0
pip 23.1.2
PyAutoGUI 0.9.54
pycparser 2.21
PyGetWindow 0.0.9
PyMsgBox 1.0.9
pyparsing 3.1.0
pyperclip 1.8.2
PyRect 0.2.0
pyscreenshot 3.1
PyScreeze 0.1.29
PySocks 1.7.1
python-dateutil 2.8.2
pytweening 1.0.7
pytz 2023.3
selenium 4.10.0
setuptools 41.2.0
six 1.16.0
sniffio 1.3.0
sortedcontainers 2.4.0
trio 0.22.1
trio-websocket 0.10.3
typing_extensions 4.6.3
urllib3 2.0.3
wsproto 1.2.0
zipp 3.15.0
補足情報(FW/ツールのバージョンなど)
ここにより詳細な情報を記載してください。
0 コメント