您可以使用src_paths选项指定项目文件夹。您不需要维护known_first_party列表。相关源码(https://github.com/PyCQA/isort/blob/5.6.4/isort/place.py#L63-L95):if ( _is_module(module_path) or _is_package(module_path) or _src_path_is_module(src_path, root_module_name)): return (sections.FIRSTPARTY, f"Found in one of the configured src_paths: {src_path}.")