Can't create class Parallel on Linux if line 215 `self.PPEXCL()` is not commented.
I don't know why, but in our recent tests when using PsychoPy parallel with an LPT port plug into a PCIe connector on Linux, we could not initialize the class Parallel. The solution found by one of my colleagues is to comment the line 215:
https://github.com/pyserial/pyparallel/blob/c79718e4fe700286dd27cfe5f756f9b37dcf48e8/parallel/parallelppdev.py#L215
As soon as I can, I will try to share with you the error raised; but this was a major roadblock for us, and might be for others as well. Tested on Python 3.8.10.
EDIT:
Parallel()
Traceback (most recent call last):
File "/tmp/ipykernel_2680/995709740.py", line 1, in <module>
Parallel()
File "/home/eeg/pyvenv/cardio-audio-sleep/lib/python3.8/site-packages/pyparallel-0.2.2-py3.8.egg/parallel/parallelppdev.py", line 216, in __init__
self.PPCLAIM()
File "/home/eeg/pyvenv/cardio-audio-sleep/lib/python3.8/site-packages/pyparallel-0.2.2-py3.8.egg/parallel/parallelppdev.py", line 247, in PPCLAIM
fcntl.ioctl(self._fd, PPCLAIM)
OSError: [Errno 6] No such device or address
A cleaner solution than commenting out the line self.PPEXCL() is to unload the lp module from the kernel:
>>> sudo rmmod lp
OR
>>> sudo modprobe -r lp
The module can be blacklisted to prevent loaded on boot by adding blacklist lp to a file in /etc/modprobe.d/ or by adding a blacklist file e.g. blacklist-parallelport.conf to /etc/modprobe.d/ containing blacklist lp.
IMO, it still is a problem that pyparallel simply doesn't work by default on Linux Ubuntu 20.04.