My parallelized script was working for a while. I used the multiprocessing
library and the function starmap
for it. But now when I'm trying to run it the following AttributeError
is displayed:
Python 3.6.5 | packaged by conda-forge | (default, Apr 6 2018,
16:13:55) [MSC v.1900 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.
IPython 6.3.1 -- An enhanced Interactive Python.
Traceback (most recent call last):
File "<ipython-input-1-d3a2b861c70a>", line 1, in <module>
runfile('E:/Python/E2Oeval.py', wdir='E:/Python')
File "C:\Users\AppData\Local\conda\conda\envs\py36\lib\site-packages\spyder\utils\site\sitecustomize.py", line 705, in runfile
execfile(filename, namespace)
File "C:\Users\AppData\Local\conda\conda\envs\py36\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "E:/Python/E2Oeval.py", line 1227, in <module>
df_Qobs_percs, df_Qsim_percs, df_sdQsim_percs, df_KGE_alpha, df_KGE_beta, df_KGE_r = ee.main_par(db_Qobs_meta_dir, Ens_mean_dir, Ens_sd_dir, db_Qobs_dir)
File "E:/Python/E2Oeval.py", line 835, in main_par
res = p.starmap(self.main, subsets)
File "C:\Users\AppData\Local\conda\conda\envs\py36\lib\multiprocessing\pool.py", line 274, in starmap
return self._map_async(func, iterable, starmapstar, chunksize).get()
File "C:\Users\AppData\Local\conda\conda\envs\py36\lib\multiprocessing\pool.py", line 644, in get
raise self._value
AttributeError: 'NoneType' object has no attribute 'write'
The error only occurs on windows, for unix the code is working. I need to run it on the windows machine since it requires some CPU power which is not given by notebook. Has anyone an idea how to detect the NoneType
object causing the error?