Package: psychopy Version: 1.83.04.dfsg-2 Severity: normal When using PsychoPy in an IPython session the following happens:
================================ In [1]: import psychopy.iohub as iohub In [2]: io = iohub.launchHubServer() --------------------------------------------------------------------------- IOError Traceback (most recent call last) <ipython-input-2-bbf8577c69ca> in <module>() ----> 1 io = iohub.launchHubServer() /usr/lib/python2.7/dist-packages/psychopy/iohub/client/__init__.pyc in launchHubServer(**kwargs) 1502 #print "IOHUB CONFIG: ",ioConfig 1503 # Start the ioHub Server -> 1504 return ioHubConnection(ioConfig) 1505 1506 ### ioHubExperimentRuntime #### /usr/lib/python2.7/dist-packages/psychopy/iohub/client/__init__.pyc in __init__(self, ioHubConfig, ioHubConfigAbsPath) 283 284 self._shutdown_attempted=False --> 285 self.iohub_status = self._startServer(ioHubConfig, ioHubConfigAbsPath) 286 if self.iohub_status != "OK": 287 raise RuntimeError("Error starting ioHub server: %s"%(self.iohub_status)) /usr/lib/python2.7/dist-packages/psychopy/iohub/client/__init__.pyc in _startServer(self, ioHubConfig, ioHubConfigAbsPath) 988 self.registerPygletWindowHandles(*whs) 989 --> 990 iopFile= open(iopFileName,'w') 991 iopFile.write("ioHub PID: "+str(Computer.iohub_process_id)) 992 iopFile.flush() IOError: [Errno 13] Permission denied: '/usr/bin/.iohpid' ================================ The reason is that in psychopy/iohub/client/__init__.py line 904 the path of sys.argv[0] is used as the location to place a PID file. Obviously, this fails for a system install of IPython. It seems that this isn't the only time this paradigm is used: % grep -R "rootScript" . ./iohub/client/__init__.py: rootScriptPath = os.path.dirname(sys.argv[0]) ./iohub/util/targetpositionsequence.py: rootScriptPath = os.path.dirname(sys.argv[0]) ./iohub/launchHubProcess.py: rootScriptPathDir=sys.argv[2] A solution for Debian could be to replace this with /var/run/user/.../psychopy, but upstream may want to adopt a more general solution. appdirs doesn't seem to support such, though. -- System Information: Debian Release: stretch/sid APT prefers testing APT policy: (650, 'testing') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 4.3.0-1-amd64 (SMP w/4 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) Versions of packages psychopy depends on: ii python 2.7.11-1 ii python-configobj 5.0.6-2 ii python-lxml 3.6.0-1 ii python-matplotlib 1.5.1-1+b1 ii python-numpy 1:1.10.4-2 ii python-opengl 3.0.2-1 ii python-pygame 1.9.1release+dfsg-10+b1 ii python-pyglet 1.1.4.dfsg-3 ii python-scipy 0.17.0-1+b1 Versions of packages psychopy recommends: ii ipython 2.4.1-1 ii libxxf86vm1 1:1.1.4-1 ii python-gevent 1.1.1-1 ii python-imaging 3.1.1-1 ii python-msgpack 0.4.6-1+b2 pn python-opencv <none> ii python-openpyxl 2.3.0-1 ii python-pandas 0.17.1-3 ii python-psutil 3.4.2-1+b1 ii python-pygame 1.9.1release+dfsg-10+b1 ii python-pyglet 1.1.4.dfsg-3 ii python-pyo 0.7.9-1 ii python-serial 3.0.1-1 ii python-wxgtk2.8 2.8.12.1+dfsg2-2 ii python-wxgtk3.0 3.0.2.0+dfsg-1+b1 ii python-xlib 0.14+20091101-5 ii python-yaml 3.11-3+b1 Versions of packages psychopy suggests: pn libavbin0 <none> pn python-iolabs <none> pn python-pyxid <none> -- no debconf information