为什么 VScode 无法识别 pynput mouse.position?

why VScode does not recognize pynput mouse.position?

我是 python 编程的初学者,我开始使用 visual studio IDE 学习它 当我使用下面的代码获取鼠标当前位置时它会工作正常但是 mouse.position 不在自动完成列表中。

from pynput.mouse import Button, Controller

mouse = Controller()

# Read pointer position
print('The current pointer position is {0}'.format(mouse.position))

我也尝试重新安装所有包括:VS Code,python,pip,但我仍然有问题。 我在 VS Code 中使用 Pylance 和 python 扩展。

请看一下我得到的屏幕截图,以便更好地理解我的问题:

https://pasteboard.co/JYHc2Vy.png

感谢任何建议。

经过几个小时的搜索后,我发现在将 VS Code 中的 pylance 扩展从 VS 中删除并恢复为 Jedi 后问题消失了(可能是 Bug 或其他东西)!