Troubles setting the parallel port to send triggers

Check the documentation at psychopy.parallel - functions for interacting with the parallel port — PsychoPy v2023.2.3

You are using the legacy functions, trying to directly set properties of the library itself. As per the documentation above:

We would strongly recommend you use the class above instead: these [functions] are provided for backwards compatibility only.

i.e. create a parallel port instance, and set the the properties of that, as shown in this example from that documentation:

from psychopy import parallel
port = parallel.ParallelPort(address = 0x0378)
port.setData(4)
port.readPin(2)
port.setPin(2, 1)
# etc