Why do we have several definitions of Cartier divisor? For example, I found in two books the following definitions:
Let $X$ be a scheme. We denote the group $H^0(X,\mathcal K_X^*/\mathcal O_X^*)$ by $\operatorname{Div}(X)$. The elements of $\operatorname{Div}(X)$ are called as Cartier divisors on $X$.
and
Let $X$ be a scheme.
An invertible sheaf on $X$ is an $\mathcal{O}_X$-module that is isomorphic to $\mathcal O_X$ locally on $X$.
A closed subscheme $D$ of $X$ is called a Cartier divisor if its defining ideal sheaf $\mathcal I_D$ is an invertible sheaf on $X$.
How can one prove that the definitions are equivalent?