Assume that $A$ and $B$ are $n$-by-$n$ real or complex matrices for some integer $n\geq 1$. If $A\,B-B\,A=I$, then $$
\begin{align}\frac{\text{d}}{\text{d}t}\,\exp(+t\,A)\,B\,\exp(-t\,A)&=\exp(+t\,A)\,(A\,B-B\,A)\,\exp(-t\,A)
\\&=\exp(+t\,A)\,I\,\exp(-t\,A)=I\,.
\end{align}$$
Hence,
$$\exp(+t\,A)\,B\,\exp(-t\,A)=C+t\,I$$
for some constant matrix $C$. Clearly, when $t=0$, we get $C=B$. Therefore,
$$\exp(+t\,A)\,B\,\exp(-t\,A)=B+t\,I\,.$$
Take the determinant on both sides to get
$$\det(B)=\det(B+t\,I)$$
for all $t\in\mathbb{R}$, but this is absurd because $\det(B+t\,I)$ is a monic polynomial in $t$ of degree $n\geq1$, whence $\det(B+t\,I)$ is nonconstant.