Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Compatibility shims for pip versions 8 thru current.

Project description!-1EAEDB.svg Documentation Status



The authors of pip do not condone the use of this package. Relying on pip’s internals is a dangerous idea for your software as they are broken intentionally and regularly. This package may not always be completely updated up PyPI, so relying on it may break your code! User beware!


Install from PyPI:

$ pipenv install --pre pip-shims

Install from Github:

$ pipenv install -e git+


pip-shims is a set of compatibilty access shims to the pip internal API. pip-shims provides compatibility with pip versions 8.0 through the current release (18.x). The shims are provided using a lazy import strategy by hacking a module by overloading a class instance’s getattr method. This library exists due to my constant writing of the same set of import shims across many different libraries, including pipenv, pip-tools, requirementslib, and passa.


Importing a shim

You can use pip-shims to expose elements of pip’s internal API by importing them:

from pip_shims import Wheel
mywheel = Wheel('/path/to/my/wheel.whl')

Available Shims

pip-shims provides the following compatibility shims:

Import Path Import Name Former Path
req.constructors _strip_extras req.req_install
cli cmdoptions cmdoptions
cli.base_command Command basecommand
cli.parser ConfigOptionParser baseparser
commands.freeze DEV_PKGS  
exceptions DistributionNotFound  
utils.hashes FAVORITE_HASH  
models FormatControl index
utils.misc get_installed_distributions utils
utils.compat stdlib_pkgs compat
cli.cmdoptions index_group cmdoptions
req.req_install InstallRequirement  
req.constructors install_req_from_line req.req_install.InstallRequirement
req.constructors install_req_from_editable req.req_install.InstallRequirement
req.req_uninstall UninstallPathSet  
distributions make_distribution_for_install_requirement operations.prepare.make_abstract_dist
distributions.base AbstractDistribution  
distributions.source SourceDistribution  
distributions.installed InstalledDistribution  
distributions.wheel WheelDistribution  
download is_archive_file  
download is_file_url  
utils.misc is_installable_dir utils
index Link  
operations.prepare make_abstract_dist req.req_set
cli.cmdoptions make_option_group cmdoptions
index CandidateEvaluator  
index PackageFinder  
req.req_file parse_requirements  
index parse_version  
download path_to_url  
__version__ pip_version  
exceptions PipError  
exceptions InstallationError  
exceptions UninstallationError  
exceptions DistributionNotFound  
exceptions RequirementsFileParseError  
exceptions BestVersionAlreadyInstalled  
exceptions BadCommand  
exceptions CommandError  
exceptions PreviousBuildDirError  
operations.prepare RequirementPreparer  
operations.freeze FrozenRequirement <__init__>
req.req_set RequirementSet  
req.req_tracker RequirementTracker  
resolve Resolver  
download SafeFileCache  
download url_to_path  
download unpack_url  
locations USER_CACHE_DIR  
vcs.versioncontrol VcsSupport vcs.VcsSupport
wheel Wheel  
wheel WheelBuilder  
cache WheelCache wheel

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pip-shims, version 0.3.3
Filename, size File type Python version Upload date Hashes
Filename, size pip_shims-0.3.3-py2.py3-none-any.whl (8.8 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size pip_shims-0.3.3.tar.gz (15.7 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page