New pip flag fixes longstanding Python frustration

Python developers are poised to benefit from a significant enhancement to pip, the standard package manager for the Python programming language. The upcoming release, version 26.2, slated for July 2026, will introduce a long-awaited feature that addresses a persistent frustration: the inability to install only the dependencies of a Python package without also installing the package itself. This development promises to streamline workflows for a variety of use cases, from testing and environment management to complex build processes in continuous integration (CI) pipelines.
For years, Python developers have encountered a limitation within pip that forced a binary choice: either install a package and all its associated dependencies, or manually extract dependency lists and install them piecemeal. This cumbersome process often necessitated workarounds, many of which involved relying on third-party tools or intricate scripting. The inability to perform a "dependencies-only" installation meant that scenarios requiring only the supporting libraries, such as setting up isolated testing environments or preparing source distributions, were needlessly complicated.
The Longstanding Need for Dependencies-Only Installation
The core issue stemmed from pip‘s design, which, until now, treated package installation as an atomic operation. When a developer requested the installation of a specific package, pip would dutifully resolve and install not only the requested package but also all of its declared runtime dependencies. While this approach is suitable for typical application deployments, it proved insufficient for more nuanced development and operational needs.
One prominent example of this limitation arises in the context of building source distributions for packages. Many packages, particularly those involving compiled extensions like C or C++ code, require build-time dependencies that are not part of the final runtime package. Tools like Cython, for instance, might be essential for generating the necessary Python extension modules during the build process but are not dependencies of the end-user application. Developers engaging in continuous integration (CI) pipelines often need to install these build-time requirements in a separate environment to facilitate the creation of source distributions. Without a direct mechanism to install these dependencies without installing the project itself, developers were compelled to resort to less elegant solutions.
Another common scenario involves setting up pristine environments for testing. Developers might wish to simulate the conditions under which their code will run on a target system, which often involves installing a specific set of libraries without introducing the primary application code into that environment. This is crucial for ensuring that tests are not inadvertently influenced by the presence of the application being tested or for verifying compatibility with various dependency versions.
A Chronicle of Workarounds and Requests
The desire for a dependencies-only installation feature has been a recurring theme within the Python developer community for over a decade. A comprehensive examination by developer James O’Claire, highlighted in a personal blog post, documented numerous instances of this request, alongside a diverse array of workarounds that developers had devised to circumvent the limitation. These workarounds frequently involved:
- Manual Parsing of
setup.pyorpyproject.toml: Developers would manually inspect the package’s metadata files to extract dependency lists, then feed these lists back intopipas separate installation commands. This process was error-prone and time-consuming. - Leveraging Third-Party Tools: A variety of external tools emerged to address this gap. These tools often provided more sophisticated dependency management capabilities, including the ability to install only dependencies. Examples include
pip-toolsfor generating pinned dependency files and more recent innovations likeuv. - Custom Scripting: Developers would write custom scripts to automate the process of extracting and installing dependencies, adding another layer of complexity to their development workflows.
The prevalence of these workarounds underscored the significant demand for a native solution within pip itself. The reliance on external tools, while functional, introduced an additional dependency for developers to manage and could sometimes lead to compatibility issues or inconsistencies.
The pip install --only-deps Solution
The forthcoming pip version 26.2 is set to rectify this long-standing issue with the introduction of the --only-deps flag. This new command will enable users to specify that they wish to install only the runtime dependencies of a given package, effectively bypassing the installation of the package code itself. The syntax for this new functionality will be straightforward:
pip install --only-deps <package_name>
This command will instruct pip to resolve and install all declared runtime dependencies for <package_name>, but it will not download or install the package code from the Python Package Index (PyPI). It is important to note that this feature specifically targets runtime dependencies. Build dependencies, which are often required for the compilation or packaging of a source distribution, will not be installed by this flag. Developers requiring build dependencies will still need to manage those separately, potentially through other pip commands or specialized build tools.
Inspiring Native Features: The uv Influence
The development of the --only-deps flag in pip is a notable example of how innovation in the broader Python ecosystem can influence the evolution of core tools. The emergence of high-performance package installers like uv has demonstrably pushed the boundaries of what is possible and what users expect from package management. uv, a Rust-based installer, has gained significant traction due to its remarkable speed and its ability to offer features like installing only dependencies, often with a command such as uv sync --no-install-project.
The success and user adoption of such features in third-party tools have likely served as a strong impetus for their integration into pip itself. By bringing this functionality directly into the native package manager, the Python Package Authority (PyPA) aims to provide a more cohesive and accessible experience for all developers, reducing the need to adopt external tooling for common tasks. This integration signifies a potential trend where the effectiveness of well-designed third-party solutions inspires the inclusion of similar capabilities in core Python infrastructure, ultimately benefiting the entire community.
Broader Implications and Future Outlook
The introduction of --only-deps is more than just a minor feature update; it represents a significant improvement in the flexibility and efficiency of Python development workflows.
- Enhanced CI/CD Pipelines: For teams leveraging CI/CD for automated testing and deployment, this feature will simplify the management of build environments. Developers can more easily set up environments that contain only the necessary tools and libraries for building artifacts, without cluttering these environments with the final application code. This can lead to faster build times and more robust testing configurations.
- Streamlined Environment Management: Creating isolated virtual environments for specific projects or tasks will become more straightforward. Developers can now precisely control the dependencies installed in an environment, ensuring that it accurately reflects the project’s requirements without unintended inclusions. This is particularly beneficial for maintaining reproducibility and avoiding dependency conflicts.
- Reduced Disk Space and Faster Installations: By selectively installing only dependencies, developers can potentially reduce the disk space occupied by virtual environments and accelerate installation times, especially in scenarios where the main package is large or complex.
- Potential for New Development Paradigms: This feature could also pave the way for new development paradigms where dependency resolution and installation are decoupled from code deployment in more granular ways.
The release of pip 26.2 is scheduled for the end of July 2026. This update, with its seemingly small but impactful --only-deps flag, demonstrates pip‘s ongoing commitment to adapting to the evolving needs of the Python development community. It underscores the power of community feedback and the influence of innovative third-party solutions in shaping the future of core development tools. As Python continues to grow in popularity and complexity, such enhancements are crucial for maintaining its position as a leading language for a wide array of applications. The ability to precisely control dependency installations marks a significant step forward, promising a more efficient and less convoluted development experience for Python practitioners worldwide.







