参考:
https://www.cnblogs.com/sadangel/p/12464990.html
https://stackoverflow.com/questions/50569453/why-does-it-say-that-module-pygame-has-no-init-member
我的电脑已经在PYCHARM里面安装了PYGAME
可以直接跳过 安装PYGAME过程
在VSCODE左下角查看 python版本

找到该Python的安装目录: \Python\Lib\site-packages

打开VSCode -> 文件 ->首选项 -> 设置 -> 用户 -> 扩展 -> Python ->Auto Complete: Extra Paths ->

搜索或者直接找PYTHON
在settings.json中编辑
“python.autoComplete.addBrackets”: true,
“python.autoComplete.extraPaths”: [“你的路径/Python/Lib/site-packages”]
这是我的路径

到此 PYgame可以运行在VSCODE了
解决 ‘pygame’ has no ‘init’ member 问题
在settings.json中编辑:
“python.linting.pylintArgs”: [
“–extension-pkg-whitelist=pygame”,
“–extension-pkg-whitelist=lxml”,
“–erros-only”
]
如图:


补充:
出现:
Python was not found but can be installed from the Microsoft Store: https://go.microsoft.com/fwlink?
要检查python是否加入到 系统的 环境变量中

