解决pyautogui.PyAutoGUIException: PyAutoGUI was unable to import pyscreeze.报错

1.“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.”
pyautogui.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.
解决方案:

pip install pyscreeze

下载依赖包,解决.

2.由于我使用的是idea的python插件,在第一次创建python项目时没有选择自己的python安装路径,于是idea自动在F盘给我创建了一个python的运行环境,然而我在命令行使用的python命令和下载的包都在D盘..... 最后通过更改运行环境解决了问题:

File➡project Structure➡SDKs解决pyautogui.PyAutoGUIException: PyAutoGUI was unable to import pyscreeze.报错

 选择自己的python目录下的python.exe

然后重启重新加载运行环境即可

上一篇:Ubuuntu20.04启动不了,VMWare Workstation下再装失败


下一篇:Spring Boot 整合 Redis 遇到 Unable to connect to Redis