You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello everyone,
today I ran into a "Multiprocessing" error with Brightway.
First, I created a conda environment. conda create --name brightway-env python=3.9
Next, I installed Brightway and PyPardiso.
`pip install brightway2`
`pip install pypardiso`
I then set up Brightway and tried to import the ecoinvent database.
"""Get started with Brightway."""importbrightway2asbw2dataimportbw2analyzerasbwa# %% Set-up Brightwaybw_project_name='my-project'# If a project with the `bw_project_name` does not exist yetifbw_project_namenotinbw2data.projects:
bw2data.projects.set_current(bw_project_name)
bw2data.bw2setup() # Add elementary flows and LCIA methods# Import/write ecoinvent databasebw2data.projects.set_current(bw_project_name)
bw_db_name="ecoinvent39cutoff"# If a database with the name `bw_db:_name` does not exist yetifbw_db_namenotinbw2data.databases:
ei=bw2data.SingleOutputEcospold2Importer(
"./data/ecoinvent-3.9/datasets/", # Database filesbw_db_name# Database name
)
ei.apply_strategies()
ei.statistics()
ei.write_database()
print(bw2data.projects) # Show projectsprint(bw2data.databases) # Show databasesdb_ei39=bw2data.Database(bw_db_name) # Load ecoinvent databasedelbw_db_name, bw_project_name# Clear the clutter
Howeber, this yielded the following error:
bw2io.errors.MultiprocessingError: Multiprocessing error; re-run using `use_mp=False`
Traceback (most recent call last):
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\site-packages\bw2io\importers\ecospold2.py", line 71, in __init__
self.data = extractor.extract(dirpath, db_name, use_mp=use_mp)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\site-packages\bw2io\extractors\ecospold2.py", line 78, in extract
with multiprocessing.Pool(processes=multiprocessing.cpu_count()) as pool:
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\context.py", line 119, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 212, in __init__
self._repopulate_pool()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 303, in _repopulate_pool
return self._repopulate_pool_static(self._ctx, self.Process,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 326, in _repopulate_pool_static
w.start()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\process.py", line 121, in start
Traceback (most recent call last):
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\site-packages\bw2io\importers\ecospold2.py", line 71, in __init__
self._popen = self._Popen(self)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\context.py", line 327, in _Popen
return Popen(process_obj)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\popen_spawn_win32.py", line 45, in __init__
self.data = extractor.extract(dirpath, db_name, use_mp=use_mp)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\site-packages\bw2io\extractors\ecospold2.py", line 78, in extract
prep_data = spawn.get_preparation_data(process_obj._name)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 154, in get_preparation_data
with multiprocessing.Pool(processes=multiprocessing.cpu_count()) as pool:
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\context.py", line 119, in Pool
_check_not_importing_main()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 134, in _check_not_importing_main
return Pool(processes, initializer, initargs, maxtasksperchild,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 212, in __init__
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.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
self._repopulate_pool()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 303, in _repopulate_pool
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 116, in spawn_main
return self._repopulate_pool_static(self._ctx, self.Process,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 326, in _repopulate_pool_static
exitcode = _main(fd, parent_sentinel)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 125, in _main
w.start()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\process.py", line 121, in start
prepare(preparation_data)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 236, in prepare
self._popen = self._Popen(self)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\context.py", line 327, in _Popen
_fixup_main_from_path(data['init_main_from_path'])
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 287, in _fixup_main_from_path
return Popen(process_obj)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\popen_spawn_win32.py", line 45, in __init__
main_content = runpy.run_path(main_path,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\runpy.py", line 288, in run_path
prep_data = spawn.get_preparation_data(process_obj._name)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 154, in get_preparation_data
return _run_module_code(code, init_globals, run_name,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\runpy.py", line 97, in _run_module_code
_check_not_importing_main()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 134, in _check_not_importing_main
_run_code(code, mod_globals, init_globals,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\runpy.py", line 87, in _run_code
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.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
exec(code, run_globals)
File "c:\users\jtesc\onedrive\01_johanna\01_uni\01_bachelorarbeit\brightway2\firststep.py", line 28, in <module>
ei = bw2data.SingleOutputEcospold2Importer(
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\site-packages\bw2io\importers\ecospold2.py", line 73, in __init__
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 116, in spawn_main
raise MultiprocessingError(
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\site-packages\bw2io\importers\ecospold2.py", line 71, in __init__
self.data = extractor.extract(dirpath, db_name, use_mp=use_mp)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\site-packages\bw2io\extractors\ecospold2.py", line 78, in extract
exitcode = _main(fd, parent_sentinel)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 125, in _main
with multiprocessing.Pool(processes=multiprocessing.cpu_count()) as pool:
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\context.py", line 119, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 212, in __init__
prepare(preparation_data)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 236, in prepare
self._repopulate_pool()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 303, in _repopulate_pool
return self._repopulate_pool_static(self._ctx, self.Process,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 326, in _repopulate_pool_static
_fixup_main_from_path(data['init_main_from_path'])
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 287, in _fixup_main_from_path
w.start()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\process.py", line 121, in start
self._popen = self._Popen(self)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\context.py", line 327, in _Popen
main_content = runpy.run_path(main_path,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\runpy.py", line 288, in run_path
return Popen(process_obj)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\popen_spawn_win32.py", line 45, in __init__
return _run_module_code(code, init_globals, run_name,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\runpy.py", line 97, in _run_module_code
prep_data = spawn.get_preparation_data(process_obj._name)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 154, in get_preparation_data
_check_not_importing_main()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 134, in _check_not_importing_main
_run_code(code, mod_globals, init_globals,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\runpy.py", line 87, in _run_code
raise RuntimeError('''
bw2io.errors.MultiprocessingError: Multiprocessing error; re-run using `use_mp=False`
exec(code, run_globals)
File "c:\users\jtesc\onedrive\01_johanna\01_uni\01_bachelorarbeit\brightway2\firststep.py", line 28, in <module>
ei = bw2data.SingleOutputEcospold2Importer(
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\site-packages\bw2io\importers\ecospold2.py", line 73, in __init__
raise MultiprocessingError(
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\site-packages\bw2io\importers\ecospold2.py", line 71, in __init__
self.data = extractor.extract(dirpath, db_name, use_mp=use_mp)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\site-packages\bw2io\extractors\ecospold2.py", line 78, in extract
with multiprocessing.Pool(processes=multiprocessing.cpu_count()) as pool:
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\context.py", line 119, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 212, in __init__
self._repopulate_pool()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 303, in _repopulate_pool
return self._repopulate_pool_static(self._ctx, self.Process,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 326, in _repopulate_pool_static
w.start()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\process.py", line 121, in start
self._popen = self._Popen(self)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\context.py", line 327, in _Popen
return Popen(process_obj)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\popen_spawn_win32.py", line 45, in __init__
prep_data = spawn.get_preparation_data(process_obj._name)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 154, in get_preparation_data
_check_not_importing_main()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 134, in _check_not_importing_main
raise RuntimeError('''
bw2io.errors.MultiprocessingError: Multiprocessing error; re-run using `use_mp=False`
Traceback (most recent call last):
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\site-packages\bw2io\importers\ecospold2.py", line 71, in __init__
self.data = extractor.extract(dirpath, db_name, use_mp=use_mp)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\site-packages\bw2io\extractors\ecospold2.py", line 78, in extract
with multiprocessing.Pool(processes=multiprocessing.cpu_count()) as pool:
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\context.py", line 119, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 212, in __init__
self._repopulate_pool()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 303, in _repopulate_pool
return self._repopulate_pool_static(self._ctx, self.Process,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 326, in _repopulate_pool_static
w.start()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\process.py", line 121, in start
self._popen = self._Popen(self)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\context.py", line 327, in _Popen
return Popen(process_obj)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\popen_spawn_win32.py", line 45, in __init__
prep_data = spawn.get_preparation_data(process_obj._name)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 154, in get_preparation_data
_check_not_importing_main()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\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.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 125, in _main
prepare(preparation_data)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 236, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 287, in _fixup_main_from_path
main_content = runpy.run_path(main_path,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\runpy.py", line 288, in run_path
return _run_module_code(code, init_globals, run_name,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\runpy.py", line 97, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "c:\users\jtesc\onedrive\01_johanna\01_uni\01_bachelorarbeit\brightway2\firststep.py", line 28, in <module>
Traceback (most recent call last):
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\site-packages\bw2io\importers\ecospold2.py", line 71, in __init__
ei = bw2data.SingleOutputEcospold2Importer(
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\site-packages\bw2io\importers\ecospold2.py", line 73, in __init__
self.data = extractor.extract(dirpath, db_name, use_mp=use_mp)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\site-packages\bw2io\extractors\ecospold2.py", line 78, in extract
raise MultiprocessingError(
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\site-packages\bw2io\importers\ecospold2.py", line 71, in __init__
with multiprocessing.Pool(processes=multiprocessing.cpu_count()) as pool:
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\context.py", line 119, in Pool
self.data = extractor.extract(dirpath, db_name, use_mp=use_mp)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\site-packages\bw2io\extractors\ecospold2.py", line 78, in extract
return Pool(processes, initializer, initargs, maxtasksperchild,
with multiprocessing.Pool(processes=multiprocessing.cpu_count()) as pool:
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 212, in __init__
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\context.py", line 119, in Pool
self._repopulate_pool()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 303, in _repopulate_pool
return Pool(processes, initializer, initargs, maxtasksperchild,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 212, in __init__
return self._repopulate_pool_static(self._ctx, self.Process,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 326, in _repopulate_pool_static
self._repopulate_pool()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 303, in _repopulate_pool
w.start()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\process.py", line 121, in start
return self._repopulate_pool_static(self._ctx, self.Process,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 326, in _repopulate_pool_static
self._popen = self._Popen(self)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\context.py", line 327, in _Popen
w.start()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\process.py", line 121, in start
self._popen = self._Popen(self)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\context.py", line 327, in _Popen
return Popen(process_obj)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\popen_spawn_win32.py", line 45, in __init__
return Popen(process_obj)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\popen_spawn_win32.py", line 45, in __init__
prep_data = spawn.get_preparation_data(process_obj._name)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 154, in get_preparation_data
prep_data = spawn.get_preparation_data(process_obj._name)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 154, in get_preparation_data
_check_not_importing_main()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 134, in _check_not_importing_main
_check_not_importing_main()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\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.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 116, in spawn_main
raise RuntimeError('''
bw2io.errors.MultiprocessingError: Multiprocessing error; re-run using `use_mp=False`
exitcode = _main(fd, parent_sentinel)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 125, in _main
prepare(preparation_data)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 236, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 287, in _fixup_main_from_path
main_content = runpy.run_path(main_path,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\runpy.py", line 288, in run_path
return _run_module_code(code, init_globals, run_name,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\runpy.py", line 97, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "c:\users\jtesc\onedrive\01_johanna\01_uni\01_bachelorarbeit\brightway2\firststep.py", line 28, in <module>
ei = bw2data.SingleOutputEcospold2Importer(
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\site-packages\bw2io\importers\ecospold2.py", line 73, in __init__
raise MultiprocessingError(
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\site-packages\bw2io\importers\ecospold2.py", line 71, in __init__
self.data = extractor.extract(dirpath, db_name, use_mp=use_mp)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\site-packages\bw2io\extractors\ecospold2.py", line 78, in extract
Traceback (most recent call last):
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\site-packages\bw2io\importers\ecospold2.py", line 71, in __init__
with multiprocessing.Pool(processes=multiprocessing.cpu_count()) as pool:
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\context.py", line 119, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 212, in __init__
self._repopulate_pool()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 303, in _repopulate_pool
self.data = extractor.extract(dirpath, db_name, use_mp=use_mp)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\site-packages\bw2io\extractors\ecospold2.py", line 78, in extract
return self._repopulate_pool_static(self._ctx, self.Process,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 326, in _repopulate_pool_static
w.start()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\process.py", line 121, in start
with multiprocessing.Pool(processes=multiprocessing.cpu_count()) as pool:
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\context.py", line 119, in Pool
self._popen = self._Popen(self)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\context.py", line 327, in _Popen
return Pool(processes, initializer, initargs, maxtasksperchild,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 212, in __init__
return Popen(process_obj)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\popen_spawn_win32.py", line 45, in __init__
prep_data = spawn.get_preparation_data(process_obj._name)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 154, in get_preparation_data
_check_not_importing_main()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 134, in _check_not_importing_main
raise RuntimeError('''
bw2io.errors.MultiprocessingError: Multiprocessing error; re-run using `use_mp=False`
self._repopulate_pool()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 303, in _repopulate_pool
return self._repopulate_pool_static(self._ctx, self.Process,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 326, in _repopulate_pool_static
w.start()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\process.py", line 121, in start
self._popen = self._Popen(self)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\context.py", line 327, in _Popen
return Popen(process_obj)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\popen_spawn_win32.py", line 45, in __init__
Traceback (most recent call last):
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\site-packages\bw2io\importers\ecospold2.py", line 71, in __init__
self.data = extractor.extract(dirpath, db_name, use_mp=use_mp)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\site-packages\bw2io\extractors\ecospold2.py", line 78, in extract
prep_data = spawn.get_preparation_data(process_obj._name)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 154, in get_preparation_data
with multiprocessing.Pool(processes=multiprocessing.cpu_count()) as pool:
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\context.py", line 119, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 212, in __init__
_check_not_importing_main()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 134, in _check_not_importing_main
self._repopulate_pool()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 303, in _repopulate_pool
return self._repopulate_pool_static(self._ctx, self.Process,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 326, in _repopulate_pool_static
w.start()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\process.py", line 121, in start
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.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
self._popen = self._Popen(self)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\context.py", line 327, in _Popen
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 116, in spawn_main
return Popen(process_obj)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\popen_spawn_win32.py", line 45, in __init__
exitcode = _main(fd, parent_sentinel)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 125, in _main
prep_data = spawn.get_preparation_data(process_obj._name)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 154, in get_preparation_data
prepare(preparation_data)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 236, in prepare
_check_not_importing_main()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 134, in _check_not_importing_main
_fixup_main_from_path(data['init_main_from_path'])
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 287, in _fixup_main_from_path
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.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
main_content = runpy.run_path(main_path,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\runpy.py", line 288, in run_path
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 125, in _main
return _run_module_code(code, init_globals, run_name,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\runpy.py", line 97, in _run_module_code
prepare(preparation_data)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 236, in prepare
_run_code(code, mod_globals, init_globals,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\runpy.py", line 87, in _run_code
_fixup_main_from_path(data['init_main_from_path'])
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 287, in _fixup_main_from_path
main_content = runpy.run_path(main_path,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\runpy.py", line 288, in run_path
exec(code, run_globals)
File "c:\users\jtesc\onedrive\01_johanna\01_uni\01_bachelorarbeit\brightway2\firststep.py", line 28, in <module>
return _run_module_code(code, init_globals, run_name,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\runpy.py", line 97, in _run_module_code
ei = bw2data.SingleOutputEcospold2Importer(
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\site-packages\bw2io\importers\ecospold2.py", line 73, in __init__
_run_code(code, mod_globals, init_globals,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\runpy.py", line 87, in _run_code
raise MultiprocessingError(
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\site-packages\bw2io\importers\ecospold2.py", line 71, in __init__
exec(code, run_globals)
File "c:\users\jtesc\onedrive\01_johanna\01_uni\01_bachelorarbeit\brightway2\firststep.py", line 28, in <module>
ei = bw2data.SingleOutputEcospold2Importer(
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\site-packages\bw2io\importers\ecospold2.py", line 73, in __init__
self.data = extractor.extract(dirpath, db_name, use_mp=use_mp)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\site-packages\bw2io\extractors\ecospold2.py", line 78, in extract
raise MultiprocessingError(
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\site-packages\bw2io\importers\ecospold2.py", line 71, in __init__
self.data = extractor.extract(dirpath, db_name, use_mp=use_mp)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\site-packages\bw2io\extractors\ecospold2.py", line 78, in extract
with multiprocessing.Pool(processes=multiprocessing.cpu_count()) as pool:
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\context.py", line 119, in Pool
with multiprocessing.Pool(processes=multiprocessing.cpu_count()) as pool:
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\context.py", line 119, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 212, in __init__
return Pool(processes, initializer, initargs, maxtasksperchild,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 212, in __init__
self._repopulate_pool()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 303, in _repopulate_pool
self._repopulate_pool()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 303, in _repopulate_pool
return self._repopulate_pool_static(self._ctx, self.Process,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 326, in _repopulate_pool_static
w.start()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\process.py", line 121, in start
return self._repopulate_pool_static(self._ctx, self.Process,
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\pool.py", line 326, in _repopulate_pool_static
self._popen = self._Popen(self)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\context.py", line 327, in _Popen
w.start()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\process.py", line 121, in start
return Popen(process_obj)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\popen_spawn_win32.py", line 45, in __init__
prep_data = spawn.get_preparation_data(process_obj._name)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 154, in get_preparation_data
self._popen = self._Popen(self)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\context.py", line 327, in _Popen
_check_not_importing_main()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 134, in _check_not_importing_main
raise RuntimeError('''
bw2io.errors.MultiprocessingError: Multiprocessing error; re-run using `use_mp=False`
return Popen(process_obj)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\popen_spawn_win32.py", line 45, in __init__
prep_data = spawn.get_preparation_data(process_obj._name)
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 154, in get_preparation_data
_check_not_importing_main()
File "C:\Users\jtesc\anaconda3\envs\brightway-env\lib\multiprocessing\spawn.py", line 134, in _check_not_importing_main
raise RuntimeError('''
bw2io.errors.MultiprocessingError: Multiprocessing error; re-run using `use_mp=False`
Does anyone have an idea what I did wrong?
The text was updated successfully, but these errors were encountered:
I have just started using Brightway, and a similar thing happened to me. As suggested by the first line of the error, the resolution was to add use_mp=False to the line which imports the database:
ei = bw2data.SingleOutputEcospold2Importer(
"./data/ecoinvent-3.9/datasets/", # Database files
bw_db_name, # Database name use_mp=False)
I'm not sure why multi-processing doesn't work on my Brightway / machine, but if I find a solution I will make a post it.
Hello everyone,
today I ran into a "Multiprocessing" error with Brightway.
First, I created a conda environment.
conda create --name brightway-env python=3.9
Next, I installed Brightway and PyPardiso.
I then set up Brightway and tried to import the ecoinvent database.
Howeber, this yielded the following error:
Does anyone have an idea what I did wrong?
The text was updated successfully, but these errors were encountered: