thanks for reaching out. The Data Lab notebooks can in principle run anywhere where you have the necessary software packages installed. All the data queries and calls happen to the Data Lab servers.
On the Data Lab notebook server / environment, we take care of all that software business. Plus, the NB server lives close to the data that you are most likely interested in.
If you still want to run a DL NB on your local machine, you will have to install whatever the NB needs. That is, everything that the 'Import' cells are importing, plus their dependencies (but the dependencies are usually taken care of when you use pip or conda to install packages).
pip install astro-datalab
pip install sparclclient
For 'desitarget', please check out: https://github.com/desihub/desitarget
Hope this helps. Please don't hesitate to ask any further questions.