问题描述:
在pycharm安装pyautogui库时,安装中断出现报错:
Try to run this command from the system terminal. Make sure that you use the correct version of 'pip' installed for your Python interpreter located at '/Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9'.
于是乎就去寻找python解释器位置。
输入where python3
,显示/usr/bin/python3
。于是我将解释器位置修改为/usr/bin/python3,但是仍然报错。
输入pip list
查看列表,能看到PyAutoGUI 0.9.52
,但是为什么在pycharm中,就不能import pyautogui
了呢?
解决方案:
想到之前安装过好几次python,并且安装过多个版本,曾使用brew install python3
安装。于是查找brew安装python的默认路径。
路径在/usr/local/Cellar/python@3.9/3.9.0_1/Frameworks/Python.framework/Versions/3.9/bin/python3.9
修改解释器路径到这个位置,然后再次安装pyautogui即可。