【问题标题】:Pylint in Visual Studio Code complaining about importing "sh" moduleVisual Studio Code 中的 Pylint 抱怨导入“sh”模块
【发布时间】:2018-08-30 21:50:36
【问题描述】:

需要帮助,我在 Visual Studio 代码中使用 Pylint 时遇到问题,不知道如何解决。

红线抱怨:

[pylint] E1101:Module 'sh' has no 'helm' member

自我:头盔

【问题讨论】:

标签: python visual-studio-code pylint


【解决方案1】:

shsys.modules__getattr__ 做了一些奇怪的事情来动态生成属性。 PyLint 不明白这一点。用pylintrc 中的ignored-modules option 告诉它停止检查sh 上的属性访问:

[TYPECHECK]
ignored-modules=sh

【讨论】:

  • 这很有帮助。顺便说一句,你知道如何在 virtrualenv 中设置 pylintrc 吗?
  • @HAO:据我所知,你的做法与没有 virtualenv 时一样,但我没有深入研究。
猜你喜欢
  • 2019-03-31
  • 2017-01-18
  • 2017-09-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-06-05
相关资源
最近更新 更多