How to reinstall a pip package even if it exists

后端 未结 2 1706
Happy的楠姐
Happy的楠姐 2020-12-31 16:09

I want to run a pip install -r requirements.txt command;

I want to run the same command over and over again;

The issue is that requirement

2条回答
  •  萌比男神i
    2020-12-31 16:44

    You want:

    pip install -r requirements.txt --upgrade --force-reinstall
    

    --force-reinstall will remove the existing packages and then install the current versions.

    --ignore-installed will just overwrite the existing with the current version, but will not remove files that were deleted in the update, meaning you may have files hanging out in your library install that aren't part of the library.

    --upgrade (redundant in this case), does force-reinstall for only those packages for which there is a new version.

提交回复
热议问题