I have Python wheel file: psutil-5.4.5-cp26-none-linux_x86_64.whl
How can I list the dependencies this wheel has?
Pip Check Command – Check Python Dependencies After Installation. Because pip doesn't currently address dependency issues on installation, the pip check command option can be used to verify that dependencies have been installed properly in your project. For example: $ pip check No broken requirements found.
Python package installed with pip , e.g. WheelPython dependencies can be specified as dependencies in your packaging, and automatically installed by pip . You can include third party C libraries in wheels, but for sufficiently complex dependencies that won't work.
Download Dependencies OnlyUse the pipdeptree utility to gather a list of all dependencies, create a requirements. txt file listing all the dependencies, and then download them with the pip download command. Get the list of dependencies for a package from the setup.py file.
One easy way of doing so is to use the pipdeptree utility. The pipdeptree works on the command line and shows the installed python packages in the form of a dependency tree.
As previously mentioned, .whl
files are just ZIP archives. You can just open them and poke around in the METADATA
file.
There is a tool, however, that can make this manual process a bit easier. You can use pkginfo, which can be installed with pip.
CLI usage:
$ pip install pkginfo $ pkginfo -f requires_dist psutil-5.4.5-cp27-none-win32.whl requires_dist: ["enum34; extra == 'enum'"]
API usage:
>>> import pkginfo >>> wheel_fname = "psutil-5.4.5-cp27-none-win32.whl" >>> metadata = pkginfo.get_metadata(wheel_fname) >>> metadata.requires_dist [u"enum34 ; extra == 'enum'"]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With