Error in PsychoPy while using debugger in pyCharm

I am using pyCharm in MAC (High Sierra 10.13.4), python3 and Psychopy 1.9. I get an error when trying to use debugger in initialisation of the window with the function visual.Window:


Traceback (most recent call last):
  File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py", line 2411, in <module>
    globals = debugger.run(setup['file'], None, None, is_module)
  File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py", line 1802, in run
    launch(file, globals, locals)  # execute the script
  File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc) 
 
  "Utilities.py", line 16, in define_initial_window
    return visual.Window(size = (width,  height) , units=unit, color='Black')
  File "/Users/oren/anaconda3/lib/python3.5/site-packages/psychopy/visual/window.py", line 375, in __init__
    self.backend = backends.getBackend(win=self, *args, **kwargs)
  File "/Users/oren/anaconda3/lib/python3.5/site-packages/psychopy/visual/backends/__init__.py", line 32, in getBackend
    return Backend(win, *args, **kwargs)
  File "/Users/oren/anaconda3/lib/python3.5/site-packages/psychopy/visual/backends/pygletbackend.py", line 102, in __init__
    allScrs = defDisp.get_screens()
  File "/Users/oren/anaconda3/lib/python3.5/site-packages/pyglet/canvas/base.py", line 65, in get_screens
    raise NotImplementedError('abstract')    
NotImplementedError: abstract

Ilease notice that when running the code without debugger it is working perfectly.
Any idea what the problem can be?

Any ideas?