79479982

Date: 2025-03-03 00:56:49
Score: 0.5
Natty:
Report link

Unfortunately there isn't a direct way to exclude specific packages during pip install.

I've created a script called pip-mark-installed to manually mark a package as installed for pip:

pip install pip-mark-installed
pip-mark-installed opencv-python

The script creates the necessary metadata files that pip uses to determine if a package is installed. To uninstall the dummy package use the normal pip uninstall.

It allows setting specific versions for the dummy packages for dependency resolution

pip-mark-installed opencv-python==4.5.1 opencv-contrib-python==4.5.1
Reasons:
  • Contains signature (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: sitic