New pip flag fixes longstanding Python frustration

A significant enhancement is poised to land in the Python ecosystem this July, addressing a long-standing frustration for developers. Pip, Python’s native package manager, is set to introduce a feature that will allow users to install only the dependencies required by a particular project, without the necessity of installing the project itself. This update, slated for pip version 26.2, promises to streamline workflows and offer greater flexibility in managing Python environments.
For years, Python developers have encountered a peculiar limitation within pip: if the objective was solely to acquire the dependencies of a given package, without its core code, there was no direct mechanism to achieve this. The available options were often cumbersome. Developers either had to manually extract the dependency list from a package’s metadata and install each one individually, a process prone to errors and time-consuming, or they were compelled to build and install the entire package, even if only its dependencies were of interest.
The Genesis of the Dependency Dilemma
The need for a "dependencies-only" installation mode stems from various practical scenarios encountered in software development. One primary use case is the creation of isolated environments for testing or for integration into other projects. In such situations, a developer might require the exact set of libraries that a specific package relies upon to function correctly, but not the package’s own implementation details. This is particularly relevant in Continuous Integration (CI) pipelines, where source distributions are generated.
During the creation of source distributions, certain requirements might be necessary for the build process itself but are not intended to be part of the final distributed package. A prime example of this involves build-time tools like Cython. To successfully generate a source distribution that might incorporate compiled extensions, these build dependencies need to be installed in a separate environment, distinct from the project being built, to facilitate the compilation step. Without a direct way to install only these dependencies, developers have often resorted to complex workarounds, including custom scripts or the use of third-party tools, to manage these build-time requirements.
A Long-Awaited Solution Emerges
The demand for a native "dependencies-only" installation feature has been a recurring theme in the Python developer community. Investigations into past discussions and issue trackers reveal numerous requests and proposed solutions over many years. Developer James O’Claire, in a detailed analysis, highlighted the prevalence of these requests and the diverse range of workarounds that have been employed, many of which involved external solutions. These often included sophisticated configurations of virtual environments, custom scripts to parse setup.py or pyproject.toml files, or the use of specialized tools designed to manage package dependencies more granularly.
The forthcoming inclusion of this functionality directly within pip signifies a significant step forward, providing a built-in solution to a problem that has historically necessitated external tools or intricate manual processes.
Pip 26.2: The "Only Deps" Command
The upcoming release of pip, version 26.2, scheduled for the end of July 2026, will introduce the pip install --only-deps command. This new flag is designed to precisely address the identified need. When executed, pip install --only-deps <package_name> will instruct pip to install all the runtime dependencies of <package_name> without installing the package itself. It is crucial to note that this command specifically targets runtime dependencies, meaning it will not automatically install build dependencies required for compiling or packaging the project. This distinction is important for developers who need to differentiate between dependencies required for development and testing versus those needed for a package to function in a production environment.
Broader Context and Third-Party Inspiration
While the pip install --only-deps command will now be a native feature, it’s worth acknowledging that similar functionality has been available through third-party tools. For instance, the rapidly evolving package installer uv offers a uv sync --no-install-project command, which achieves the same outcome of installing only project dependencies. The integration of this capability directly into pip suggests a growing trend where innovations pioneered by third-party projects are being adopted and incorporated into the core Python tooling. This can be seen as a testament to the iterative nature of software development, where successful concepts are often generalized and made accessible to a wider audience. The success of tools like uv, known for its impressive speed and efficiency in package management, has demonstrably influenced the direction of core Python development tools, prompting the integration of features that enhance developer experience and productivity.
Implications for the Python Development Workflow
The introduction of pip install --only-deps is expected to have several positive implications for the Python development community:
- Simplified Environment Management: Developers will be able to create more precisely tailored environments for specific tasks. For example, when preparing a testing environment for a library, they can now easily install only the dependencies that library requires, avoiding the overhead of installing the library itself.
- Streamlined CI/CD Pipelines: Continuous Integration and Continuous Deployment pipelines can be made more efficient. Build processes that rely on specific dependencies for compilation or packaging can be more cleanly managed, ensuring that only the necessary tools are installed for the build stage. This can lead to faster build times and reduced resource consumption.
- Reduced Reliance on Workarounds: The need for complex, often fragile, workarounds or third-party scripts to achieve dependency-only installations will be significantly diminished. This will lead to cleaner, more maintainable codebases and reduce the potential for errors introduced by manual dependency management.
- Enhanced Security and Isolation: By precisely defining and installing only the required dependencies, developers can potentially improve the security posture of their projects. Unnecessary packages, which might carry their own vulnerabilities, are not installed, leading to a more minimalist and controlled dependency set.
- Improved Developer Experience: Ultimately, this feature contributes to a smoother and more intuitive developer experience. By removing a long-standing friction point, pip continues to evolve as a robust and user-friendly tool for managing Python packages.
A Timeline of Evolution
The journey towards this feature highlights the iterative development process within the Python ecosystem. While the exact origins of the request can be traced back many years, the concrete implementation has been a collaborative effort.
- Early Years: Developers likely encountered the need for dependency-only installs organically, employing manual methods or simple scripts.
- Mid-2010s Onwards: As Python projects grew in complexity and CI/CD practices became more widespread, the limitations of pip became more apparent. Issue trackers and forums saw an increase in discussions and feature requests related to this capability.
- Late 2010s – Early 2020s: Third-party tools like
uvemerged, demonstrating effective solutions and influencing the broader community’s expectations. Discussions within the Python Packaging Authority (PyPA) likely intensified, recognizing the value of a native solution. - Recent Development: The development of the
pip install --only-depsfeature within pip’s codebase, culminating in its inclusion in version 26.2, represents the culmination of these ongoing efforts. The pull request for this feature (#13895) signifies the final stages of integration and testing. - July 2026: The official release of pip 26.2, making this feature widely available to all Python developers.
Official Responses and Community Reception
While specific official statements regarding the pip install --only-deps feature prior to its release are not extensively documented in public forums, the inclusion of such a highly requested feature within pip’s development roadmap is indicative of its recognized importance by the Python Packaging Authority (PyPA). The presence of numerous discussions and feature requests on platforms like GitHub and Stack Overflow over many years underscores a strong community demand. The successful implementation and merging of the pull request demonstrate consensus and prioritization within the pip development team.
Community reception, based on past discussions and the general positive reaction to improvements in package management, is anticipated to be overwhelmingly favorable. Developers have long expressed their desire for more granular control over package installations, and this update directly addresses that need. The analogy drawn to the success of uv further suggests that features enhancing efficiency and developer experience are well-received and actively sought after.
The Future of Python Package Management
The addition of pip install --only-deps is more than just a new command; it represents a maturing of Python’s package management infrastructure. As the Python ecosystem continues to grow and diversify, the tools that support it must evolve to meet new challenges and demands. This update demonstrates pip’s commitment to staying relevant and providing developers with the flexibility and power they need to build complex applications efficiently and reliably. The ongoing interplay between core tools and innovative third-party projects, as exemplified by the influence of uv, is likely to continue shaping the future of Python package management, leading to more streamlined, performant, and developer-friendly solutions.






