Hello,
I have difficulties to send a message on the parallel port using PsychoPy in a python script (not using the standalone)
I tried multiple times and on multiple computers (Ubuntu 16.04, Windows 10, Linux Mint 18.3), and I always end up with the same error message :
$ python2 send_triggers.py
fatal: Not a git repository (or any of the parent directories): .git
Traceback (most recent call last):
File "send_triggers.py", line 23, in <module>
parallel.setData(0)
File "/usr/lib/python2.7/dist-packages/psychopy/parallel/__init__.py", line 161, in setData
raise RuntimeError('Port address must be set using setPortAddress')
RuntimeError: Port address must be set using setPortAddress
Here is the code that triggered the error message :
from pynput import keyboard
import time
from psychopy import parallel
keys_to_listen = ('z', 'x', ',', '.') #definition of variables irrelevant to the current bug
markers_press = (1, 2, 3, 4)
markers_release = (10, 20, 30, 40)
is_pressed = [False, False, False, False]
####set parallel port
parallel.setPortAddress(address=0x0378)
parallel.setData(0)
time.sleep(2)
I found this similar topic on the forum but the trick (putting inpout32.dll in the same directory as the script) didn’t work (even on Windows 10): Cannot send a signal via ParallelPort using PsychoPy on Windows7 (64bit)
One thing to note is that I am currently testing this script on computers that doesn’t have any parallel ports. However, when I went to try the script on the stimulation computer (which has a parallel port) I had the same error message.
Another (maybe) useful thing to note is that when I installed PsychoPy I had an error message saying that pyobjc-core and iolabs failed to install properly. Pyobjc-core says it requires macOS to be installed, so it’s likely not a problem, but I am suspicious about iolabs.
Do someone have an idea about what is going wrong ? I’m starting to feel like I am the mistake since I can’t make it work on any computer
Thanks !