I'm not sure this is possible. Google does not seem to have any answers.
Running Linux Debian can I list all pip packages and size (amount of disk space used) thats installed?
i.e. List all pip
packages with size on disk?
I'm not sure this is possible. Google does not seem to have any answers.
Running Linux Debian can I list all pip packages and size (amount of disk space used) thats installed?
i.e. List all pip
packages with size on disk?
History :
There is no command or applications developed for that purpose at the moment, we need to check that manually
Manual Method I :
This does not include packages/files installed out of that directory, thus said we will get 95% with those 2 simples command
Also if you have other version of python installed, you need to adapt the directory
Manual Method II :
Search the install directory with the package name with case insensitive
Manual Method II Alternative I :
Search the install directory with the package name with lowered case
Manual Method II Alternative II :
Search the install directory with the package name
Note :
For methods using
du
, output lines starting withdu: cannot access
need to be checked manually; The command use the install directory and add to it the name of the package but some times the package name and directory name are different...Make it simple :
I followed below steps to calculate disk usage of all packages
du -h path/to/all/packages
Note - Insert any package name in place of some package e.g pandas
Bonus - find size of particular pip package
pip3 show "package_name" | grep "Location:"
this will return path/to/all/packages
du -h path/to/all/packages/package_name
Go to the package site to find the size e.g. https://pypi.python.org/pypi/pip/json
Modified above for pip version 18 and above:
This command shows pip packages, sorted by descending order of sizes.
Could please try this one(A bit long though, maybe there are better solutions):
the output should look like this:
should works if the package is installed in
Location/Name
. (location and name are frompip show <package>
)pip show <package>
will show you the location:we get the
Name
andLocation
to join them to get the location, finally usedu -sh
to get the package size.New version for new pip list format: