vscode E1101 警告問題 轉

 pylint E1101:Module 'matplotlib.cm' has no 'hot' member @vscode

https://github.com/pytorch/pytorch/issues/701

Instead of ignoring, you can now do:
 
[TYPECHECK]
 
# List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E1101 when accessed. Python regular
# expressions are accepted.
generated-members=numpy.*,torch.*

Follow the above cue, vscode setting should be

"python.linting.pylintArgs":
        [
            "--generated-members=matplotlib.*, pygame.*",
        ],

 

  1. 在terminal裏 (例如Windows 平臺的powershell)導航到項目所在目錄;
  2. 爲Pylint生成rcfile文件:
    1 pylint --generate-rcfile > .pylintrc
  3. 打開生成的文件.pylintrc,將模塊名添加至白名單:extension-pkg-whitelist=xxx。以 lxml爲例,結果爲:

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章