How can I use a pip requirements file to uninstall as well as install packages?

前端 未结 10 1398
猫巷女王i
猫巷女王i 2021-01-30 04:48

I have a pip requirements file that changes during development.

Can pip be made to uninstall packages that do not appear in the requirement

10条回答
  •  清歌不尽
    2021-01-30 05:30

    Piggybacking off @stephen-j-fuhry here is a powershell equivalent I use:

    pip freeze | ? { $_ -notmatch ((gc req.txt) -join "|") }
    

提交回复
热议问题