简体   繁体   中英

How to override python package version constraint during pip install

We have an organization level constraint file to specify what versions of python packages can be installed. This is configured in pip.conf

For one of the project, we want to install a different version of a package. For example, pyyaml is pinned at 5.4.1 in constraints file, whereas for the project we would like 6.0

Tried specifying inline in pip install command,

pip install pyyaml==6.0 

This didn't help as the build failed with conflict error,

ERROR: Cannot install pyyaml==6.0 because these package versions have conflicting dependencies.

The conflict is caused by:
The user requested pyyaml==6.0
The user requested (constraint) pyyaml==5.4.1

pip version: 21.3.1
# constrains.txt
   pyyaml==5.4.1
$ pip install pyyaml==6.0 -c constrains.txt

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM