Пул - Многопроцессорная обработка - [Errno 13] В доступе отказано - PullRequest
1 голос
/ 12 марта 2020

Я пытаюсь запустить Jupyter Notebook, который использует «Пул» из пакета «Многопроцессорность» и получает сообщение об ошибке «[Errno 13] Permission denied»

---------------------------------------------------------------------------
PermissionError                           Traceback (most recent call last)
<timed exec> in <module>

<ipython-input-9-9d32e1938b9e> in get_ray_tracing(rays, population_element)
      7     # Necessario para o windows
      8     if __name__ ==  '__main__':
----> 9         p=Pool(processes = len(rays))
     10         # O jupyter notebook necessita que a funcao esteja em um arquivo diference
     11         # O programa ficara travado nessa linha ate que todos os processos terminem

/snap/jupyter/6/lib/python3.7/multiprocessing/context.py in Pool(self, processes, initializer, initargs, maxtasksperchild)
    117         from .pool import Pool
    118         return Pool(processes, initializer, initargs, maxtasksperchild,
--> 119                     context=self.get_context())
    120 
    121     def RawValue(self, typecode_or_type, *args):

/snap/jupyter/6/lib/python3.7/multiprocessing/pool.py in __init__(self, processes, initializer, initargs, maxtasksperchild, context)
    156                  maxtasksperchild=None, context=None):
    157         self._ctx = context or get_context()
--> 158         self._setup_queues()
    159         self._taskqueue = queue.SimpleQueue()
    160         self._cache = {}

/snap/jupyter/6/lib/python3.7/multiprocessing/pool.py in _setup_queues(self)
    249 
    250     def _setup_queues(self):
--> 251         self._inqueue = self._ctx.SimpleQueue()
    252         self._outqueue = self._ctx.SimpleQueue()
    253         self._quick_put = self._inqueue._writer.send

/snap/jupyter/6/lib/python3.7/multiprocessing/context.py in SimpleQueue(self)
    110         '''Returns a queue object'''
    111         from .queues import SimpleQueue
--> 112         return SimpleQueue(ctx=self.get_context())
    113 
    114     def Pool(self, processes=None, initializer=None, initargs=(),

/snap/jupyter/6/lib/python3.7/multiprocessing/queues.py in __init__(self, ctx)
    330     def __init__(self, *, ctx):
    331         self._reader, self._writer = connection.Pipe(duplex=False)
--> 332         self._rlock = ctx.Lock()
    333         self._poll = self._reader.poll
    334         if sys.platform == 'win32':

/snap/jupyter/6/lib/python3.7/multiprocessing/context.py in Lock(self)
     65         '''Returns a non-recursive lock object'''
     66         from .synchronize import Lock
---> 67         return Lock(ctx=self.get_context())
     68 
     69     def RLock(self):

/snap/jupyter/6/lib/python3.7/multiprocessing/synchronize.py in __init__(self, ctx)
    160 
    161     def __init__(self, *, ctx):
--> 162         SemLock.__init__(self, SEMAPHORE, 1, 1, ctx=ctx)
    163 
    164     def __repr__(self):

/snap/jupyter/6/lib/python3.7/multiprocessing/synchronize.py in __init__(self, kind, value, maxvalue, ctx)
     57                 sl = self._semlock = _multiprocessing.SemLock(
     58                     kind, value, maxvalue, self._make_name(),
---> 59                     unlink_now)
     60             except FileExistsError:
     61                 pass

PermissionError: [Errno 13] Permission denied

Я безуспешно пытался применить предложения вопроса Python многопроцессорная обработка: отказано в разрешении - переполнение стека

Что еще можно попробовать?

...