An imporant thing to add is that if you install some deps with magics you won’t be able to use Library Manager for python packages. It will install them once but when you start this notebook next time on the other machine it will try to install them before running the cell with deps and the initialization will fail.
So currently the right way is
!sudo apt update
!sudo apt install unixodbc-dev -y
!pip install pyodbc