Brightway 2 / Agribalyse BW2Package.import spyder freezing issue [WIN]

87 Views Asked by At

I would like to clarify a particular issue that is happening in spyder (win conda env, python 3.11, spyder 5.4.3) when importing the Agribalyse database.

Issue description: when importing the Agribalyse database package using the indications provided here, spyder simply freezes (i.e. nothing happens). I will reproduce the code here in case the workbook gets moved or deleted:

import brightway2 as bw

bw.projects.set_current('Importing agribalyse3.1')
bw.bw2setup()

import os
bw.BW2Package.import_file(os.path.join(os.path.realpath(''), 'data', 'AGB31.bw2package'))

Potential cause of the problem: having already downloaded other databases using BW2, I am not 100 % sure if the issue is caused by the use of multiprocessing in the function BW2Package.import_file(), which causes spyder to freeze into a multiprocess hell, of which many and more examples are known.

I have tried to solve the issue by running the code in an external Win cmd window as suggested in some of the answers, but the result is just me staring at an empty window long after this have been initialized.

I had this problem importing the ecoinvent database setting multiprocessing (use_mp) to False in order be able to bring it to success:

ei_importer = bi.SingleOutputEcospold2Importer(ei_path, ei_name, use_mp=False)

I assume this might be a similar issue running for Agribalyse? I would just like to receive confirmation so that I could just forget about it and directly use the solution provided here (import of the .CSV database instead of the BW2Package). However, since this appear to be a recurring issue for Win users, might it be feasible to add a "use_mp" attribute so that, in case this were the problem, it would be possible to use BW2Package.importfile() without issues?

0

There are 0 best solutions below