psychopy.org | Reference | Downloads | Github

Error occurred while running psychopy code in spyder

Hello,

Python version: 2.7 (spyder, anaconda2)
psychopy: StandalonePsychoPy2-1.90.3-win32

I want to use psychopy to trigger the EEG using parallel port.

My code can be run in the standalone Psychopy without error, and I can see markers in the EEG data.
Since I use python directly to trigger another device, I tried to run psychopy in spyder after executing the following command in Anaconda prompt:

conda install wxpython
pip install pyglet psychopy

I didn’t come across problems while importing psychopy modules. However, error occurred when the code was being executed, and the error is like this:

runfile('C:/Users/BIAPT2/Desktop/PsychoPy Experiment/Win32/test_v0.py', wdir='C:/Users/BIAPT2/Desktop/PsychoPy Experiment/Win32')
Could not import DLportIO driver, parallel Ports not available
Traceback (most recent call last):

  File "<ipython-input-6-4e011ca13845>", line 1, in <module>
    runfile('C:/Users/BIAPT2/Desktop/PsychoPy Experiment/Win32/test_v0.py', wdir='C:/Users/BIAPT2/Desktop/PsychoPy Experiment/Win32')

  File "C:\Users\BIAPT2\Anaconda2\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile
    execfile(filename, namespace)

  File "C:\Users\BIAPT2\Anaconda2\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 95, in execfile
    exec(compile(scripttext, filename, 'exec'), glob, loc)

  File "C:/Users/BIAPT2/Desktop/PsychoPy Experiment/Win32/test_v0.py", line 17, in <module>
    port = parallel.ParallelPort(address=0x0378)

  File "C:\Users\BIAPT2\Anaconda2\lib\site-packages\psychopy\parallel\_dlportio.py", line 77, in __init__
    raise e

WindowsError: [Error 126] The specified module could not be found

Since the device is old and can only be triggered using python 2.7, does anyone know how to solve this?

Hi - I’m assuming that since your code works in PsychoPy, you definitely do have the DLportIO driver already installed. Is Spyder/Anaconda2 the 32-bit distribution? Sometimes errors come up with mismatches here.