Deeplabcut launching problem

I installed DLC on Macbook pro according to the instructions on the website and Nature Protocols paper. I tried to load the GUI interface using deeplabcut.launch_dlc() and I get the error: NameError: name ‘deeplabcut’ is not defined.
I googled the error msg but couldn’t find any solution. It’s probably something simple but I can’t make it work.

Has anybody had this problem before?

Thanks,
Kobi

Dear Kobi,

Welcome to the Forum! I suspect you did not

import deeplabcut

first or you are not in the correct environment (where deeplabcut is installed).

Alexander

Thanks Alexander
I imported and got the following message.

Ok, I suppose you should install wxpython then. See https://github.com/AlexEMG/DeepLabCut/blob/master/conda-environments/README.md#creating-your-own-customized-conda-env

Dear Kobi,

You cannot use ipython on macOS, you need to use pythonw. Please see here:

Thus, you need to (1) enter your anaconda env, something like "source activate dlc-macos-cpu:
then:


pythonw

import deeplabcut 

deeplabcut.launch_dlc()
1 Like

Thank you both. I did as you advised but it is still not loading.


I used it from Anaconda with the dlc-macOS-CPU environment, as you can see.
Any ideas how to proceed?

Yes, you need to install wxPython; seems it did not install correctly into you env. As alex mentions: https://github.com/AlexEMG/DeepLabCut/blob/master/conda-environments/README.md#creating-your-own-customized-conda-env

Which means once you are inside your env, you can run “pip install -U wxPython”

Now I get an error that it needs access to the screen:

In [6]: import deeplabcut

In [7]: deeplabcut.launch_dlc()
An exception has occurred, use %tb to see the full traceback.

SystemExit: 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.

/Users/yacovkoffler/opt/anaconda3/envs/dlc-macOS-CPU/lib/python3.6/site-packages/IPython/core/interactiveshell.py:3339: UserWarning: To exit: use ‘exit’, ‘quit’, or Ctrl-D.
warn(“To exit: use ‘exit’, ‘quit’, or Ctrl-D.”, stacklevel=1)

and here is the traceback:

SystemExit Traceback (most recent call last)
in
----> 1 deeplabcut.launch_dlc()

~/opt/anaconda3/envs/dlc-macOS-CPU/lib/python3.6/site-packages/deeplabcut/gui/launch_script.py in launch_dlc()
41
42 def launch_dlc():
—> 43 app = wx.App()
44 frame = MainFrame().Show()
45 app.MainLoop()

~/opt/anaconda3/envs/dlc-macOS-CPU/lib/python3.6/site-packages/wx/core.py in init(self, redirect, filename, useBestVisual, clearSigInt)
2100 # TODO: more description is needed for wxMSW…
2101
-> 2102 raise SystemExit(msg)
2103
2104 # This has to be done before OnInit

SystemExit: 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.

Because you used ipython again. You need to use pythonw. Please check the docs carefully as this is explained there :wink: and in my post above…

It’s alive! thank you

1 Like