Sometimes you may need to find out the dependencies of certain Python packages before installing them on your system. Here is how to quickly check Python package dependencies.
How to Check Python Package Dependencies
There are several ways to get python package dependencies – using pip and using pipedeptree.
1. Using pip
You can easily get package dependencies in python using pip show command. Here is its syntax.
$ pip show [package_name]
Here is an example to get package dependencies of Tornado package.
$ pip show tornado --- Name: tornado Version: 4.1 Location: ***** Requires: certifi, backports.ssl-match-hostname
2. Using pipdeptree
You can also use pipedeptree package to get dependency information. Here is the command to install it.
$ pip install pipedeptree
Once it is installed, you can use this command to get package dependencies all or specific packages on your system. Here is a sample output.
$ pipedeptree flake8==2.5.0 - mccabe [required: >=0.2.1,<0.4, installed: 0.3.1] - pep8 [required: !=1.6.0,>=1.5.7,!=1.6.1,!=1.6.2, installed: 1.5.7] - pyflakes [required: >=0.8.1,<1.1, installed: 1.0.0] ipdb==0.8 - ipython [required: >=0.10, installed: 1.1.0]
That’s it. In this short article, we have learnt how to easily get package dependencies in Python.
How to Check Python Package Path
How to Take Screenshot in Ubuntu Terminal
How to Make Cross Database Queries in PostgreSQL
How to Make Cross Database Queries in MySQL
How to Copy Data to Another Database in MySQL