pip freeze
This is a python built-in module that can help us know the dependent packages but it shows all dependencies as a flat list, finding out which are the top-level packages and which packages do they depend on requires some effort. Let us see an example of how it works:
Type given below command on your command prompt:
$pip freeze
Output:
altair==4.1.0 attrs==19.3.0 docutils==0.15.2 entrypoints==0.3 Jinja2==2.11.2 jmespath==0.10.0 jsonschema==3.2.0 MarkupSafe==1.1.1 numpy==1.18.4 opencv-python==4.2.0.34 pandas==1.0.4 pyrsistent==0.16.0 python-dateutil==2.8.1 pytz==2020.1 six==1.15.0 toolz==0.10.0 urllib3==1.25.9
Dependency tree of a Python Module
Generally, many Python packages are dependent on other packages but how do we know that on which packages is a module dependent?