New install, error when running deeplabcut on macOS

After installing dlc on macOS Mojave, I receive an error that dlc can’t be imported when running the Demo_labeledexample_MouseReaching notebook. The kernel is set correctly, I believe. I worked on it about 6 hours yesterday, to no avail. I would love to get this going!

(dlc-macOS-CPU) Johns-iMac-Pro:~ john$ python --version
Python 3.6.8 :: Anaconda, Inc.

When the notebook first opens:

This program needs access to the screen. Please run with a
Framework build of python, and only when you are logged in
on the main display of your Mac.

Then when trying to run the first cell:

Hey John, welcome to the forum! So it seems the dlc env is not showing up, so in the terminal inside your env run conda install nb_conda_kernels That should fix that issue. But, for GUIs the program needs a “framework” build of python, so you’ll need to use “pythonw” - once you activate you env (which you did!) you type “pythonw” then Import deeplabcut

Then you can follow these steps https://www.biorxiv.org/content/early/2018/11/24/476531 to set up and label data, and then perhaps transfer the folder to the cloud for GPU use! (See Colab Notebooks)

Thanks for the reply.

The problem (not finding deeplabcut) occurred within Jupyter Notebook. I’m not sure how I would tell it to use pythonw instead of python, etc.
Very new to this. I’ve been using MATLAB and want to broaden my horizons. DLC will be great for our lab too.

Hi John,

So it’s two issues;

(1) not finding DLC is because you are not inside the correct environment (you only see root). It should say something like “conda env:DLC2” or whatever you called it. So, to fix this error, you just need to run, in the terminal before you type Jupyter notebook, conda install nb_conda_kernels

(2) but, to use GUIs you need access to a screen, so in general you want to just use the terminal to run DLC on MacOS. Check out the users guide for the commands and YouTube for video tutorials on this!

1 Like