diff --git a/vip_hci/preproc/badpixremoval.py b/vip_hci/preproc/badpixremoval.py index 434d3c16..5c67fe4b 100644 --- a/vip_hci/preproc/badpixremoval.py +++ b/vip_hci/preproc/badpixremoval.py @@ -36,7 +36,18 @@ from .cosmetics import frame_pad from multiprocessing import Process import multiprocessing -from multiprocessing import shared_memory, set_start_method +from multiprocessing import set_start_method +try: + from multiprocessing import shared_memory +except ImportError: + print('Failed to import shared_memory from multiprocessing') + try: + print('Trying to import shared_memory directly(for python 3.7)') + import shared_memory + except ModuleNotFoundError: + print('Use shared_memory on python 3.7 to activate') + print('multiprocessing on badpixels using..') + print('pip install shared-memory38') import warnings try: diff --git a/vip_hci/preproc/cosmetics.py b/vip_hci/preproc/cosmetics.py index 8c4eb4e6..7bd0d82c 100644 --- a/vip_hci/preproc/cosmetics.py +++ b/vip_hci/preproc/cosmetics.py @@ -1,5 +1,5 @@ #! /usr/bin/env python -# check123 + """ Module with cosmetics procedures. Contains the function for bad pixel fixing. Also functions for cropping cubes. @@ -23,7 +23,18 @@ from ..var import frame_center, get_square from multiprocessing import Process import multiprocessing -from multiprocessing import shared_memory, set_start_method +from multiprocessing import set_start_method +try: + from multiprocessing import shared_memory +except ImportError: + print('Failed to import shared_memory from multiprocessing') + try: + print('Trying to import shared_memory directly(for python 3.7)') + import shared_memory + except ModuleNotFoundError: + print('Use shared_memory on python 3.7 to activate') + print('multiprocessing on badpixels using..') + print('pip install shared-memory38') def cube_crop_frames(array, size, xy=None, force=False, verbose=True,