Why does it say that module pygame has no init member?

前端 未结 14 1188
予麋鹿
予麋鹿 2020-12-01 13:57

This is the code I have:

import pygame
pygame.init()

I\'m very confused because if I try to run the file, then there seems to be no issue,

14条回答
  •  旧巷少年郎
    2020-12-01 14:33

    If you have VS code, go in your .vscode folder > settings.json or search for python.linting.mypyArgs Under user settings tab paste inbetween curly braces

    "python.linting.pylintArgs": [
        "--extension-pkg-whitelist=lxml"  // The extension is "lxml" not "1xml"
    ]
    

    I no longer see the pyinit error.

提交回复
热议问题