| Reference | Downloads | Github

Blank screen in Psychopy!



I am trying to run Python scripts for a Brain Computer Interface Paradigm that uses Psychopy as GUI to create a visual stimuli. I am using Mac OS and the scripts are tun through the terminal I get the following message: “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.”

I am using Python 2.7 and latest version of Psychopy.

Running the scripts via coder view pops-up a new blank Psychopy screen. Does it has something to do with the command " from pylab import * " in the python scripts?

Thanks in Advance!


Try running your script with pythonw rather than python.


I have tried running scripts using pythonw instead of python and it opens up the Psychopy GUI to enter some initial data… Once I enter those, following message gets displayed on my terminal : "2017-08-10 16:44:12.166 python[52381:2593862] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/cs/_c0k8l3j6m771s2pjk_fj0280000gn/T/com.continuum.python.savedState
<type ‘str’>
<type ‘float’>

GUI of Psychopy starts loading, but nothing happens! I am still not able to see anything!


This is the error I am getting - Traceback (most recent call last):
File “”, line 46, in
import run_ssvep
File “/Users/divz/Documents/EEG_Toolbox-master/”, line 60, in
File “/Users/divz/Documents/EEG_Toolbox-master/”, line 48, in run
File “/Users/divz/Documents/EEG_Toolbox-master/”, line 59, in start
File “/Users/divz/Documents/EEG_Toolbox-master/”, line 40, in collecting
self.collector = csv_collector.CSVCollector(fname=self.fname, port= self.port)
File “/Users/divz/Documents/EEG_Toolbox-master/”, line 22, in init
self.board = OpenBCIBoard(port, baud)
File “/Users/divz/Documents/EEG_Toolbox-master/”, line 60, in init
File “/Users/divz/Documents/EEG_Toolbox-master/”, line 121, in dump_registry_data
line = self.ser.readline()
File “/Users/divz/anaconda/lib/python2.7/site-packages/serial/”, line 475, in read
raise SerialException(‘read failed: {}’.format(e))
serial.serialutil.SerialException: read failed: [Errno 6] Device not configured

Can someone please help me out?


We would need to see the code where you initialise your serial port and try to use it. Also describe what software you installed to communicate with the serial port.

Mac’s don’t have serial ports of course, so I’m guessing you have some sort of USB serial adapter, with appropriate driver?


This is the portion of the code where serial port is mentioned.

 Core OpenBCI object for handling connections and samples from the board.


def handle_sample(sample):

 board = OpenBCIBoard()


import serial
import struct
import numpy as np

SAMPLE_RATE = 250.0  # Hz
START_BYTE = bytes(0xA0)  # start of data packet
END_BYTE = bytes(0xC0)  # end of data packet

def find_port():
  import platform, glob

s = platform.system()
if s == 'Linux':
    p = glob.glob('/dev/tty.usbserial-DQ007Z1Y')

elif s == 'Darwin':
    p = glob.glob('/dev/tty.usbserial-DQ007Z1Y')

if len(p) >= 1:
    return p[0]
    return None

class OpenBCIBoard(object):


Handle a connection to an OpenBCI board.

port: The port to connect to.
baud: The baud of the serial connection.


def __init__(self, port='None', baud=115200, filter_data=True):
  if not port:
     port = find_port()
  if not port:
    raise OSError('Cannot find OpenBCI port')
 port = find_port()
  if not port:
    raise OSError('Cannot find OpenBCI port')

self.ser = serial.Serial(port, baud)
self.streaming = False
self.filtering_data = filter_data
self.channels = 8

I am using Open BCI Cyton board for obtaining brain signal. The software is used is OpenBCI_Python (
I have installed FTDI driver on my Mac.

This is the original github link from where I used the code. (



Hi, I have edited the code.

Also, I have one more question. While installing Psychopy, what are the dependencies that need to be installed along with it. Please let me know.




All the dependencies are listed on the download/install page here:

From memory the only thing that was slightly awkward was getting a precompiled version of wxpython for macOS.

I had similar problems to you, and ended up taking Jon Peirce’s advice and using the standalone version as it provides all the necessary dependencies and a working Python 2.7 installation for Psychopy.

Best wishes,