Reputation: 109
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,))
chmod -R 777 /usr/local/lib/python2.7/dist-packages/joblib
; to no avail: the permission error remainsSo 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?
Upvotes: 2
Views: 5601
Reputation: 109
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
Upvotes: 4