Python multiprocessing: Permission denied

前端 未结 3 923
暗喜
暗喜 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:29

    In my OVH VPS Classic, this error was caused by a loop in /dev/shm and /run/shm. Both were symlinks linking to each other. So as root here is what I did:

    # rm /dev/shm
    # mkdir /dev/shm
    # chmod 777 /dev/shm
    # nano /etc/fstab
    

    Then I modified the shm line from:

    none /dev/shm tmpfs rw 0 0
    

    To:

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

    Restarted the server... And that fixed the problem! Alternatively you can mount shm manually:

    # mount /dev/shm
    

    Hope this helps :-)

提交回复
热议问题