Text of codeql.github.com › codeql-query-help › python › py-repeated-import as Styx crawled it on Nov 19, 2026. The page may have changed since. Only its words are kept, without pictures or layout.

Open the live page

Module is imported more than once — CodeQL query help documentation

CodeQL query help documentation » CodeQL query help for Python » Module is imported more than once ¶ ID: py/repeated-import Kind: problem Security severity: Severity: recommendation Precision: very-high Tags: - quality - maintainability - useless-code Query suites: - python-code-quality.qls - python-security-and-quality.qls Click to see the query in the CodeQL repository Importing the same module more than once has no effect as each module is only loaded once.

It also confuses readers of the code. Recommendation ¶ Remove the second import. Example ¶ import module1 import module2 import module1 # Duplicate import References ¶ Python: import statement . © GitHub, Inc. Terms Privacy