psychopy.org | Reference | Downloads | Github

Running Psychopy on a public notebook server - NoSuchDisplayException: Cannot connect to "None"

I am trying to run psychopy on a public notebook server. However, the module “visual” does not work:

Typing in a jupyter notebook: from psychopy import visual gives me the following error message:

NoSuchDisplayException                    Traceback (most recent call last)
<ipython-input-8-a055fe0ea9be> in <module>
----> 1 from psychopy import visual
      2 
      3 
      4 

/usr/local/lib/python3.6/site-packages/psychopy/visual/__init__.py in <module>
     26 from .text import TextStim
     27 from .form import Form
---> 28 from .button import ButtonStim
     29 from .brush import Brush
     30 # window, should always be loaded first

/usr/local/lib/python3.6/site-packages/psychopy/visual/button.py in <module>
     10 from __future__ import absolute_import, print_function
     11 
---> 12 from psychopy import event
     13 from psychopy.visual.shape import BaseShapeStim
     14 from psychopy.visual.text import TextStim

/usr/local/lib/python3.6/site-packages/psychopy/event.py in <module>
     59         _default_display_ = pyglet.window.get_platform().get_default_display()
     60     else:
---> 61         _default_display_ = pyglet.canvas.get_display()
     62 
     63 

/usr/local/lib/python3.6/site-packages/pyglet/canvas/__init__.py in get_display()
     92 
     93     # Otherwise, create a new display and return it.
---> 94     return Display()
     95 
     96 

/usr/local/lib/python3.6/site-packages/pyglet/canvas/xlib.py in __init__(self, name, x_screen)
    121         self._display = xlib.XOpenDisplay(name)
    122         if not self._display:
--> 123             raise NoSuchDisplayException('Cannot connect to "%s"' % name)
    124 
    125         screen_count = xlib.XScreenCount(self._display)

NoSuchDisplayException: Cannot connect to "None"

any help is appreciated! Thanks in advance!

Could you solve this problem? I’m getting the same error

Do you mean that you aren’t using Pavlovia? PsychoPy3 will only run on Pavlovia and PsychoPy2 is far more limited in its features .

Best wishes,

Wakefield