Python multiprocessing: Permission denied

前端 未结 3 916
暗喜
暗喜 2020-11-28 07:53

I\'m getting an error when trying to execute python program that uses multiprocessing package:

  File \"/usr/local/lib/python2.6/multiprocessing/__init__.py\         


        
3条回答
  •  清酒与你
    2020-11-28 08:19

    For POSIX semaphores to work, the users need r/w access to shared memory (/dev/shm).

    Check the permissions to /dev/shm. On my laptop (Ubuntu) it looks like this:

    $ ls -ld /dev/shm
    drwxrwxrwt 2 root root          40 2010-01-05 20:34 shm
    

    To permanently set the correct permissions (even after a reboot), add the following to your /etc/fstab:

    none /dev/shm tmpfs rw,nosuid,nodev,noexec 0 0
    

    Haven't tried this, just copied from a forum post.

提交回复
热议问题