Tool to mark packages as installed in pip without actually installing them.
Project description
pip-mark-installed
A utility tool to mark packages as installed in pip without actually installing them.
Description
pip-mark-installed creates the necessary metadata files to make pip believe that a package is installed, without actually installing any of the package code. This is particularly useful for resolving conflicts between different package variants that share the same namespace (e.g., different OpenCV distributions, system installations of pytorch etc.).
Installation
Grab the pip-mark-installed.py script or install it via pip:
pip install pip-mark-installed
Usage
pip-mark-installed PACKAGE_SPEC [PACKAGE_SPEC ...]
Where PACKAGE_SPEC can be either:
PACKAGE_NAME(uses a default future version)PACKAGE_NAME==VERSION
Examples
Mark a package with default version:
pip-mark-installed.py opencv-python
Mark multiple packages with specific versions:
pip-mark-installed.py opencv-python-headless==4.5.1 opencv-contrib-python==4.5.1
Specify a custom site-packages directory:
pip-mark-installed.py --site-packages /path/to/site-packages some-package
Common Use Cases
For example, OpenCV has several Python package variants that conflict with each other:
opencv-python(standard build)opencv-python-headless(without GUI)opencv-contrib-python(with extra modules)opencv-contrib-python-headless(extra modules, no GUI)
Different dependencies might specify different variants, leading to accidental file overwrites and runtime errors. pip-mark-installed can help you resolve these conflicts by marking undesired packages as installed without actually installing them:
# First install the variant you actually want
pip install opencv-python-headless
# Then mark the conflicting package as installed
pip-mark-installed opencv-python
How It Works
The script creates the necessary .dist-info directory structure and metadata files that pip uses to determine if a package is installed.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pip_mark_installed-0.0.1.tar.gz.
File metadata
- Download URL: pip_mark_installed-0.0.1.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98b702de53ef7efe3aca7d5fe3b483f8b8e2815906fdf9ceb021034baea9cd91
|
|
| MD5 |
7ba3d45158b40e89660cafa07010e595
|
|
| BLAKE2b-256 |
ac03c92bf910ec6d8aecbe872e65a7ceeaf7db7c121c82bfa5165488d213fb3c
|
File details
Details for the file pip_mark_installed-0.0.1-py2.py3-none-any.whl.
File metadata
- Download URL: pip_mark_installed-0.0.1-py2.py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4de413b924f3c25fdb7224a2d80ab1e2d308e95ed04a7ec2dacf83318a4d3d8
|
|
| MD5 |
186c8357a96e0ef1a84c8548235ec6ea
|
|
| BLAKE2b-256 |
b8a02e0ee89e68846d67e9fc66ac458405dd0ccb0e601585d6a5c894d07f4b26
|