Lune

ICSE2024Top-tier venue

ModuleGuard: Understanding and Detecting Module Conflicts in Python Ecosystem

Ruofan Zhu, Xingyu Wang, Chengwei Liu, Zhengzi Xu, Wenbo Shen, Rui Chang, Yang Liu

Abstract

Python has become one of the most popular programming languages for software development due to its simplicity, readability, and versatility. As the Python ecosystem grows, developers face increasing challenges in avoiding module conflicts, which occur when different packages have the same namespace modules. Unfortunately, existing work has neither investigated the module conflict comprehensively nor provided tools to detect the conflict. Therefore, this paper systematically investigates the module conflict problem and its impact on the Python ecosystem. We propose a novel technique called InstSimulator, which leverages semantics and installation simulation to achieve accurate and efficient module extraction. Based on this, we implement a tool called ModuleGuard to detect module conflicts for the Python ecosystem. For the study, we first collect 97 MC issues, classify the characteristics and causes of these MC issues, summarize three different conflict patterns, and analyze their potential threats. Then, we conducted a large-scale analysis of the whole PyPI ecosystem (4.2 million packages) and GitHub popular projects (3,711 projects) to detect each MC pattern and analyze their potential impact. We discovered that module conflicts still impact numerous TPLs and GitHub projects. This is primarily due to developers' lack of understanding of the modules within their direct dependencies, not to mention the modules of the transitive dependencies. Our work reveals Python's shortcomings in handling naming conflicts and provides a tool and guidelines for developers to detect conflicts.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

1 top-tier paper has cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Fixing dependency errors for Python build reproducibility cites Watchman: monitoring dependency conflicts for Python library ecosystem
  • Restoring Execution Environments of Jupyter Notebooks cites Watchman: monitoring dependency conflicts for Python library ecosystem
  • Knowledge-Based Environment Dependency Inference for Python Programs cites Watchman: monitoring dependency conflicts for Python library ecosystem
  • Knowledge-Based Environment Dependency Inference for Python Programs cites Fixing dependency errors for Python build reproducibility
  • Knowledge-Based Environment Dependency Inference for Python Programs cites Restoring Execution Environments of Jupyter Notebooks
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers1

  1. My Model is Malware to You: Transforming AI Models into Malware by Abusing TensorFlow APIsRuofan Zhu, Ganhao Chen, Wenbo Shen, Xiaofei Xie et al.S&P 2025

Builds on8

  1. Watchman: monitoring dependency conflicts for Python library ecosystemYing Wang, Ming Wen, Yepang Liu, Yibo Wang et al.ICSE 2020 · 65 citations
  2. Fixing dependency errors for Python build reproducibilitySuchita Mukherjee, Abigail Almanza, Cindy Rubio-GonzálezISSTA 2021 · 55 citations
  3. Restoring Execution Environments of Jupyter NotebooksJiawei Wang, Li Li, Andreas ZellerICSE 2021 · 49 citations
  4. An Empirical Study of Malicious Code In PyPI EcosystemWenbo Guo, Zhengzi Xu, Chengwei Liu, Cheng Huang et al.ASE 2023 · 31 citations
  5. Knowledge-Based Environment Dependency Inference for Python ProgramsHongjie Ye, Wei Chen, Wensheng Dou, Guoquan Wu et al.ICSE 2022 · 21 citations

Related papers

  1. Less is More? An Empirical Study on Configuration Issues in Python PyPI EcosystemYun Peng, Ruida Hu, Ruoke Wang, Cuiyun Gao et al.ICSE 2024 · 5 citations
  2. smartPip: A Smart Approach to Resolving Python Dependency Conflict IssuesChao Wang, Rongxin Wu, Haohao Song, Jiwu Shu et al.ASE 2022 · 15 citations
  3. Cutting the Gordian Knot: Detecting Malicious PyPI Packages via a Knowledge-Mining FrameworkWenbo Guo, Chengwei Liu, Ming Kang, Yiran Zhang et al.USENIX Security 2026 · 1 citation
  4. Uncovering Similar but Different Packages in PyPI and Potential Security ThreatsSunha Park, Soojin Han, Seunghoon WooFSE 2026
  5. ConfuGuard: Using Metadata to Detect Active and Stealthy Package Confusion Attacks Accurately and at ScaleWenxin Jiang, Berk Çakar, Mikola Lysenko, James C DavisICSE 2026 · 2 citations
Dusk over the sea between two cliffs drawn in fine vertical lines