pipdeptree icon indicating copy to clipboard operation
pipdeptree copied to clipboard

List installed packages that are not dependencies of another installed package.

Open clysto opened this issue 3 years ago • 4 comments

using homebrew I can simply use brew leaves to show all installed formulae that are not dependencies of another installed formula.

How to do the same thing using pipdeptree?

Something equivalent to this:

pipdeptree --r -a | rg -U "^[^ ].*\n[^ ].*\n" | sed -n "p;n"

clysto avatar Dec 20 '20 15:12 clysto

There's no direct way to do this. Does the above command work?

Also, what's rg?

naiquevin avatar Dec 23 '20 13:12 naiquevin

rg is ripgrep similar to grep command. It support mutiline search.

截屏2020-12-24 上午9 34 24

If pipdeptree can do this in a direct way, it will be more convenient😊.

pipdeptree is a awsome tool!

clysto avatar Dec 24 '20 01:12 clysto

Thanks for the kind words :-) It should be quite simple to implement. Curious to understand the use case for this. In what way do you use these leaf packages output?

naiquevin avatar Dec 25 '20 06:12 naiquevin

Sometimes I want to get the specific packages I installed, and I can safely delete the packages listed by leaves.

clysto avatar Dec 26 '20 07:12 clysto

This sounds like -r combined with https://github.com/tox-dev/pipdeptree/issues/89

gaborbernat avatar Sep 06 '22 07:09 gaborbernat