A
A
Albert2018-11-05 00:58:39
Python
Albert, 2018-11-05 00:58:39

How to get a list of installed Python libraries sorted by size on Ubuntu?

There is Ubuntu which has a lot of Python libraries installed mostly with pip install.
How to get their list sorted by size?
Preferably via terminal

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladislav Klimanov, 2018-11-05
@bigburn

pip3 list --format freeze | awk -F = {'print $1'} | xargs pip3 show | grep -E 'Location:|Name:' | cut -d ' ' -f 2 | paste -d ' ' - - | awk '{print $2 "/" tolower($1)}' | xargs du -sh 2> /dev/null | sort -h

for mac at the end instead of `sort -h` I use `gsort -h`

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question