有没有办法指示 Pylint 哪些库应该被视为第 3 方?

Is there a way to instruct Pylint which libraries should be considered 3rd party?

我是 运行 pylint 在某些导入库不可用且是第 3 方的环境中。因此,pylint 为这些导入生成错误 class wrong-import-order C0411。

有没有办法指示哪个应被视为第 3 方?

是的,那将是 known-third-party,您可以在 [IMPORTS]:

下设置

# Force import order to recognize a module as part of a third party library. known-third-party=your modules