英文:
"Import "pyautogui" could not be resolved from source" while having pyautogui installed on VS Code
问题
我现在遇到了PyAutoGUI的问题。我已经将它安装在以下路径:
C:\msys64\mingw64\lib\python3.9\site-packages
但是VS Code似乎无法识别它。
我收到了以下消息:
无法从源中解析导入 "pyautogui"
我已经尝试重新安装所有内容,设置路径并验证安装。
英文:
I'm having trouble right now with PyAutoGUI. I have installed it in:
C:\msys64\mingw64\lib\python3.9\site-packages
but VS Code doesn't seem to recognize it.
I get this message:
> Import "pyautogui" could not be resolved from source
I've already tried reinstalling everything, set paths and verify installations.
答案1
得分: 0
使用<kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> --> 选择 Python:选择解释器
来选择正确的解释器。
如果您的计算机上有多个Python版本,您需要选择已安装pyautogui包的版本。
您可以使用以下代码检查当前解释器路径。
import sys
print(sys.executable)
英文:
Use <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> --> Python:Select Interpreter
to select the correct interpreter.
If there are multiple python versions on your machine, you need to use the one that has the pyautogui package installed.
You can check the current interpreter path with the following code.
import sys
print(sys.executable)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论