2

The following permission error occurs when I try importing joblib from script or python -c 'import joblib':

/usr/local/lib/python2.7/dist-packages/joblib//joblib_multiprocessing_helpers.py:29: UserWarning: [Errno 13] Permission denied.  joblib will operate in serial mode
      warnings.warn('%s.  joblib will operate in serial mode' % (e,))
  • joblib is installed and forcefully reinstalled via pip
  • importing works as superuser
  • I set full permissions on the joblib folder chmod -R 777 /usr/local/lib/python2.7/dist-packages/joblib; to no avail: the permission error remains

So even though every user and group has full rwx permissions on the joblib directory it gives me a permission error. How do I figure out on which directory joblib does the write permission check when importing? Why does it even do the check before I specified a write operation?

GJacobs
  • 109
  • 1
  • 10

1 Answers1

4

Found it by looking a in the joblib source code:

The problem was that semaphoring was not enabled on my system: Joblib checks for multiprocessing.Semaphore() and it turns out that only root had read/write permission on shared memory in /dev/shm. Fixed it as per this answer by permanently setting the correct permissions (even after a reboot) by adding the following to your /etc/fstab:

none /dev/shm tmpfs rw,nosuid,nodev,noexec 0 0 and then remount mount /dev/shm -o remount

Community
  • 1
  • 1
GJacobs
  • 109
  • 1
  • 10