[Python3][pylint]C0412:Imports from package XXXXX are not grouped

パッケージXXXXのインポート位置がまとまっていません。

エラー例

collectionsパッケージを2箇所でインポートしていますが、間に別のパッケージのインポートが入っているためにエラーになっています。
import collections
import re
from collections import namedtuple

Status = namedtuple('Status', 'index workTree filePath')
dict = collections.OrderedDict()

解決方法1

インポート順を変更し、同一パッケージのインポートを連続して行います。
import re
import collections
from collections import namedtuple

Status = namedtuple('Status', 'index workTree filePath')
dict = collections.OrderedDict()

解決方法2

「from XXXX」によるインポートを削除し、クラス使用時にパッケージ名を明示的に指定します。
import collections
import re

Status = collections.namedtuple('Status', 'index workTree filePath')
dict = collections.OrderedDict()

解決方法3

「import XXXX」によるインポートを削除し、全て「from XXXX」でインポートをします。
import re
from collections import namedtuple, OrderedDict

Status = namedtuple('Status', 'index workTree filePath')
dict = OrderedDict()

検証環境

関連ページ