| Reference | Downloads | Github

Define monitor without "monitor center" (no standalone psychopy)

Hi everyone,

I have installed psychopy manually using a conda environment and then getting all required packages and modules via conda install or pip install.

How can I define my monitor like I would from the “monitor center” gui as included in the standalone version? I have already seen the instructions in the manual but from what I read this seems to be something that should be used after one has already defined a monitor through the gui.

I still went ahead and tried defining my monitor. When running the code however, I got this error message:

Traceback (most recent call last):
  File "", line 50, in <module>
  File "//anaconda/envs/psychopy_env/lib/python2.7/site-packages/psychopy/visual/", line 638, in flip
  File "//anaconda/envs/psychopy_env/lib/python2.7/site-packages/psychopy/visual/", line 289, in draw
    vertsPix = self.verticesPix
  File "//anaconda/envs/psychopy_env/lib/python2.7/site-packages/psychopy/visual/", line 467, in verticesPix
  File "//anaconda/envs/psychopy_env/lib/python2.7/site-packages/psychopy/visual/", line 506, in _updateVertices, units=self.units)
  File "//anaconda/envs/psychopy_env/lib/python2.7/site-packages/psychopy/tools/", line 82, in convertToPix
    return unit2pixFunc(vertices, pos, win)
  File "//anaconda/envs/psychopy_env/lib/python2.7/site-packages/psychopy/tools/", line 33, in _deg2pix
    return deg2pix(pos + vertices, win.monitor)
  File "//anaconda/envs/psychopy_env/lib/python2.7/site-packages/psychopy/tools/", line 236, in deg2pix
    raise ValueError(msg %
ValueError: Monitor mbp has no known size in pixels (SEE MONITOR CENTER)

I’d be grateful for either:

  • An example of an exhaustive monitor definition using only code
  • A way how to access the monitor gui so that I can:
    • define my monitor exhaustively there once
    • … and then use the code as described in the manual, to make smaller adjustments

After reading the above linked instruction manual more carfully and until the end, I found the solution:

# Define a monitor
my_monitor = monitors.Monitor(name='my_monitor_name')
my_monitor.setSizePix((1280, 800))

After that, you will be able to load “my_monitor_name” when opening a visual.window


Thanks, Stefan. I just ran into this problem today and was hoping to find a solution in the forum.