MIT-LCP / MIT-LCP/wfdb-python

The `dl_files` function is giving an error

Abierto
#306 4 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Lenguaje dominante
Jupyter Notebook
Estrellas
853
Forks
322
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

The wfdb.io.dl_files function is working in older version of python (v3.6) but is failing with the following error in a newer version (3.9.5):

Downloading files...
Traceback (most recent call last):
  File "/Users/briangow/Documents/MIT/physionet/physionet-build/env/lib/python3.9/multiprocessing/spawn.py", line 125, in _main
    prepare(preparation_data)
  File "/Users/briangow/Documents/MIT/physionet/physionet-build/env/lib/python3.9/multiprocessing/spawn.py", line 236, in prepare
    _fixup_main_from_path(data['init_main_from_path'])
  File "/Users/briangow/Documents/MIT/physionet/physionet-build/env/lib/python3.9/multiprocessing/spawn.py", line 287, in _fixup_main_from_path
    main_content = runpy.run_path(main_path,
  File "/Users/briangow/Documents/MIT/physionet/physionet-build/env/lib/python3.9/runpy.py", line 268, in run_path
    return _run_module_code(code, init_globals, run_name,
  File "/Users/briangow/Documents/MIT/physionet/physionet-build/env/lib/python3.9/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/Users/briangow/Documents/MIT/physionet/physionet-build/env/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Users/briangow/Documents/MIT/physionet/physionet-build/temp_credentialed_download.py", line 5, in <module>
    wfdb.io.dl_files('mitdb','/Users/briangow/Documents/MIT/physionet/files',['115.dat'])
  File "/Users/briangow/Documents/MIT/physionet/physionet-build/env/lib/python3.9/site-packages/wfdb/io/download.py", line 531, in dl_files
    pool = multiprocessing.Pool(processes=2)
  File "/Users/briangow/Documents/MIT/physionet/physionet-build/env/lib/python3.9/multiprocessing/context.py", line 119, in Pool
    return Pool(processes, initializer, initargs, maxtasksperchild,
  File "/Users/briangow/Documents/MIT/physionet/physionet-build/env/lib/python3.9/multiprocessing/pool.py", line 212, in __init__
    self._repopulate_pool()
  File "/Users/briangow/Documents/MIT/physionet/physionet-build/env/lib/python3.9/multiprocessing/pool.py", line 303, in _repopulate_pool
    return self._repopulate_pool_static(self._ctx, self.Process,
  File "/Users/briangow/Documents/MIT/physionet/physionet-build/env/lib/python3.9/multiprocessing/pool.py", line 326, in _repopulate_pool_static
    w.start()
  File "/Users/briangow/Documents/MIT/physionet/physionet-build/env/lib/python3.9/multiprocessing/process.py", line 121, in start
    self._popen = self._Popen(self)
  File "/Users/briangow/Documents/MIT/physionet/physionet-build/env/lib/python3.9/multiprocessing/context.py", line 284, in _Popen
    return Popen(process_obj)
  File "/Users/briangow/Documents/MIT/physionet/physionet-build/env/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 32, in __init__
    super().__init__(process_obj)
  File "/Users/briangow/Documents/MIT/physionet/physionet-build/env/lib/python3.9/multiprocessing/popen_fork.py", line 19, in __init__
    self._launch(process_obj)
  File "/Users/briangow/Documents/MIT/physionet/physionet-build/env/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 42, in _launch
    prep_data = spawn.get_preparation_data(process_obj._name)
  File "/Users/briangow/Documents/MIT/physionet/physionet-build/env/lib/python3.9/multiprocessing/spawn.py", line 154, in get_preparation_data
    _check_not_importing_main()
  File "/Users/briangow/Documents/MIT/physionet/physionet-build/env/lib/python3.9/multiprocessing/spawn.py", line 134, in _check_not_importing_main
    raise RuntimeError('''
RuntimeError: 
        An attempt has been made to start a new process before the
        current process has finished its bootstrapping phase.
        This probably means that you are not using fork to start your
        child processes and you have forgotten to use the proper idiom
        in the main module:
            if __name__ == '__main__':
                freeze_support()
                ...
        The "freeze_support()" line can be omitted if the program
        is not going to be frozen to produce an executable.
python-BaseException

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

El traceback identifica wfdb.io.dl_files y multiprocessing.Pool como puntos de entrada; reproduce la descarga en Python 3.9.5 e inspecciona cómo la función inicia los workers. La tarea estará terminada cuando la misma llamada a dl_files descargue el archivo solicitado sin el error de inicio de multiprocessing.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python
Área
backend
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.