How do I get PyLint to recognize numpy members?

前端 未结 22 1122
南旧
南旧 2020-11-28 20:29

I am running PyLint on a Python project. PyLint makes many complaints about being unable to find numpy members. How can I avoid this while avoiding skipping membership check

22条回答
  •  生来不讨喜
    2020-11-28 20:41

    I had the same issue here, even with the latest versions of all related packages (astroid 1.3.2, logilab_common 0.63.2, pylon 1.4.0).

    The following solution worked like a charm: I added numpy to the list of ignored modules by modifying my pylintrc file, in the [TYPECHECK] section:

    [TYPECHECK]
    
    ignored-modules = numpy
    

    Depending on the error, you might also need to add the following line (still in the [TYPECHECK] section):

    ignored-classes = numpy
    

提交回复
热议问题