  It is known that a knot complement (minus two points) decomposes into ideal
octahedra with respect to a given knot diagram. In this paper, we study the
Ptolemy variety for such an octahedral decomposition in perspective of
Thurston's gluing equation variety. More precisely, we compute explicit Ptolemy
coordinates in terms of segment and region variables, the coordinates of the
gluing equation variety motivated from the volume conjecture. As a consequence,
we present an explicit formula for computing the obstruction to lifting a
$(\mathrm{PSL}(2,\mathbb{C}),P)$-representation of the knot group to a
$(\mathrm{SL}(2,\mathbb{C}),P)$-representation. We also present a diagrammatic
algorithm to compute a holonomy representation of the knot group.
