find the dependencies of python package

Two ways

  1. Go into a shell with the dependencies installed
In [1]:  from importlib.metadata import requires

In [2]: requires('Django')
Out[2]:
['asgiref (<4,>=3.3.2)',
 'pytz',
 'sqlparse (>=0.2.2)',
 "argon2-cffi (>=19.1.0) ; extra == 'argon2'",
 "bcrypt ; extra == 'bcrypt'"]
  1. Read the poetry.lock file
[[package]]
name = "django"
version = "3.2.20"
description = "A high-level Python Web framework that encourages rapid development and clean, pragmatic design."
optional = false
python-versions = ">=3.6"
files = [
    {file = "Django-3.2.20-py3-none-any.whl", hash = "sha256:a477ab326ae7d8807dc25c186b951ab8c7648a3a23f9497763c37307a2b5ef87"},
    {file = "Django-3.2.20.tar.gz", hash = "sha256:dec2a116787b8e14962014bf78e120bba454135108e1af9e9b91ade7b2964c40"},
]

[package.dependencies]
asgiref = ">=3.3.2,<4"
pytz = "*"
sqlparse = ">=0.2.2"

[package.extras]
argon2 = ["argon2-cffi (>=19.1.0)"]
bcrypt = ["bcrypt"]