Rafael Borja
Rafael Borja

Reputation: 4907

pip installl - skip specific dependencies

How can pip skip only one dependency while install all the others. Using --no-deps, --no-dependencies as answered on this topic would not work since it prevents all depencencies.

The reason I need to skip a single dependency is due to the fact this dependency is not compatible under my environment (I have a personalized version of this dependency instead)

Upvotes: 5

Views: 5265

Answers (1)

sinoroc
sinoroc

Reputation: 22295

Maybe use a requirements.txt or constraints.txt file to let pip know to use your modified version of the dependency. These 2 files have different meanings and different options that they can handle, so depending on your exact needs one or the other might be a better fit. I would recommend using the constraints.txt file if possible.

A.

# requirements.txt
TheDependency --find-links /path/to/dir/containing/modified-dependency
python -m pip install Something --requirement requirements.txt

B.

# constraints.txt
TheDependency @ /path/to/modified-dependency-1.2.3.whl
python -m pip install Something --constraint constraints.txt

Upvotes: 3

Related Questions