解決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

 選擇自己的python目錄下的python.exe

然后重啟重新加載運行環境即可


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM