Giter Club home page Giter Club logo

brightway2's Introduction

Brightway2 life cycle assessment framework

Brightway2 is a framework for advanced life cycle assessment calculations. It consists of several components which each accomplish specific tasks. This package is a container for all the separate components, for ease of documentation and installation.

Brightway2 is inspired by the Brightway software, which was developed during Chris Mutel's PhD work at ETH Zurich, but is a complete rewrite focusing on simplicity, power, and ease of use. Brightway2 can run on all major operating systems.

Official site

Online documentation

Development blog

Packages

brightway2's People

Contributors

arturszilagyi avatar cardosan avatar cmutel avatar marc-vdm avatar michaelweinold avatar pascallesage avatar threefx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

brightway2's Issues

Migrate conda packaging to conda forge

Migrating to conda forge

Conda forge offers a number of advantages (big team maintaining CI and packaging, easier installation), but the most important is it makes it much easier to build os- or arch-specific packages, which we absolutely need for MacOS ARM64 machines.

Libraries

Here are the libraries which need to be added:

  • brightway2
  • brightway25
  • bw2analyzer
  • bw2calc
  • bw2data
  • bw2io
  • bw2parameters
  • bw_migrations
  • bw_processing
  • constructive_geometries
  • matrix_utils
  • mrio_common_metadata
  • rower
  • stats_arrays
  • wurst

For each library, take the following steps:

  • Fork conda forge staged-recipes
  • Create a new branch from the staged-recipes master branch
  • Adapt the existing recipe in a new "recipes/[your-package-name]" directory
  • Propose the change as a pull request to the conda forge repo
  • Ping the team when it builds correctly: @conda-forge/help-python, this is ready for review

Adapting the recipes

Make sure to add yourself as the maintainer, e.g.

extra:
  recipe-maintainers:
    - cmutel

Apparently the forge build is good enough that the following can be dropped:

build:
  ignore_run_exports:
    - python_abi

Delete source: fn if present.

More complete test section:

test:
  imports:
    - {{ name }}
  commands:
    - pip check
  requires:
    - pip

Change build: script command:

build:
  script: {{ PYTHON }} -m pip install . -vv

Make Python version in build and run to be >=3.6 if noarch

Fix license to be valid SPDX, e.g. BSD-3-Clause

Replace setuptools with pip in build section.

brightway2 lcia methods missing

This may be a minor issue due to improper setup -

Installed brightway2 using pip - python 3.8

from brightway2 install *

len(methods) 

gives 0. methods is empty.
The LCIA methods are not showing up. Any help would be appreciated.

brightway2 import error

Hi, i'm trying to import brightway2 in an virtual environment using pipenv. I get the following error:

brightwaybash-3.2$ pipenv install brightway2
Installing brightway2...
Error: An error occurred while installing brightway2!
Error text: Collecting brightway2
Using cached brightway2-2.4.2.tar.gz (3.4 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting appdirs
Using cached appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
Collecting asteval
Using cached asteval-0.9.26.tar.gz (40 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting bw2analyzer<0.10.99
Using cached bw2analyzer-0.10.tar.gz (26 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting bw2calc==1.8.1
Using cached bw2calc-1.8.1.tar.gz (56 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting bw2data<3.99
Using cached bw2data-3.6.4.tar.gz (106 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting bw2io<0.8.9
Using cached bw2io-0.8.6.tar.gz (26.9 MB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting bw2parameters>=0.6.5
Using cached bw2parameters-0.7.tar.gz (20 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting docopt
Using cached docopt-0.6.2.tar.gz (25 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting eight
Using cached eight-1.0.1-py2.py3-none-any.whl (10 kB)
Collecting flask
Using cached Flask-2.1.1-py3-none-any.whl (95 kB)
Collecting future
Using cached future-0.18.2.tar.gz (829 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting lxml
Using cached lxml-4.8.0-cp310-cp310-macosx_10_15_x86_64.whl (4.6 MB)
Requirement already satisfied: numpy in /Users/datascience/.local/share/virtualenvs/recovo-VTYhDz3q/lib/python3.10/site-packages (from brightway2->-r /var/folders/61/vkwks5vs40j9pzn9vtzdt0bh0000gp/T/pipenv-c7spf7zh-requirements/pipenv-j12qgmub-requirement.txt (line 1)) (1.22.3)
Collecting peewee>=3.0
Using cached peewee-3.14.10.tar.gz (855 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: psutil in /Users/datascience/.local/share/virtualenvs/recovo-VTYhDz3q/lib/python3.10/site-packages (from brightway2->-r /var/folders/61/vkwks5vs40j9pzn9vtzdt0bh0000gp/T/pipenv-c7spf7zh-requirements/pipenv-j12qgmub-requirement.txt (line 1)) (5.9.0)
Collecting pyprind
Using cached PyPrind-2.11.3-py2.py3-none-any.whl (8.4 kB)
Requirement already satisfied: requests in /Users/datascience/.local/share/virtualenvs/recovo-VTYhDz3q/lib/python3.10/site-packages (from brightway2->-r /var/folders/61/vkwks5vs40j9pzn9vtzdt0bh0000gp/T/pipenv-c7spf7zh-requirements/pipenv-j12qgmub-requirement.txt (line 1)) (2.27.1)
Requirement already satisfied: scipy in /Users/datascience/.local/share/virtualenvs/recovo-VTYhDz3q/lib/python3.10/site-packages (from brightway2->-r /var/folders/61/vkwks5vs40j9pzn9vtzdt0bh0000gp/T/pipenv-c7spf7zh-requirements/pipenv-j12qgmub-requirement.txt (line 1)) (1.8.0)
Collecting stats_arrays>=0.6.5
Using cached stats_arrays-0.6.5.tar.gz (23 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting unicodecsv
Using cached unicodecsv-0.14.1.tar.gz (10 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting voluptuous
Using cached voluptuous-0.13.1-py3-none-any.whl (29 kB)
Collecting whoosh
Using cached Whoosh-2.7.4-py2.py3-none-any.whl (468 kB)
Collecting xlrd
Using cached xlrd-2.0.1-py2.py3-none-any.whl (96 kB)
Collecting xlsxwriter
Using cached XlsxWriter-3.0.3-py3-none-any.whl (149 kB)
Collecting matplotlib
Using cached matplotlib-3.5.1-cp310-cp310-macosx_10_9_x86_64.whl (7.3 MB)
Requirement already satisfied: pandas in /Users/datascience/.local/share/virtualenvs/recovo-VTYhDz3q/lib/python3.10/site-packages (from bw2analyzer<0.10.99->brightway2->-r /var/folders/61/vkwks5vs40j9pzn9vtzdt0bh0000gp/T/pipenv-c7spf7zh-requirements/pipenv-j12qgmub-requirement.txt (line 1)) (1.4.2)
Collecting tabulate
Using cached tabulate-0.8.9-py3-none-any.whl (25 kB)
Collecting fasteners
Using cached fasteners-0.17.3-py3-none-any.whl (18 kB)
Collecting wrapt
Using cached wrapt-1.14.0-cp310-cp310-macosx_10_9_x86_64.whl (35 kB)
Collecting bw_migrations
Using cached bw_migrations-0.2.tar.gz (10 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting mrio_common_metadata
Using cached mrio_common_metadata-0.2.tar.gz (12 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: openpyxl in /Users/datascience/.local/share/virtualenvs/recovo-VTYhDz3q/lib/python3.10/site-packages (from bw2io<0.8.9->brightway2->-r /var/folders/61/vkwks5vs40j9pzn9vtzdt0bh0000gp/T/pipenv-c7spf7zh-requirements/pipenv-j12qgmub-requirement.txt (line 1)) (3.0.9)
Collecting unidecode
Using cached Unidecode-1.3.4-py3-none-any.whl (235 kB)
Collecting astunparse
Using cached astunparse-1.6.3-py2.py3-none-any.whl (12 kB)
Requirement already satisfied: certifi>=2017.4.17 in /Users/datascience/.local/share/virtualenvs/recovo-VTYhDz3q/lib/python3.10/site-packages (from requests->brightway2->-r /var/folders/61/vkwks5vs40j9pzn9vtzdt0bh0000gp/T/pipenv-c7spf7zh-requirements/pipenv-j12qgmub-requirement.txt (line 1)) (2021.10.8)
Requirement already satisfied: charset-normalizer~=2.0.0 in /Users/datascience/.local/share/virtualenvs/recovo-VTYhDz3q/lib/python3.10/site-packages (from requests->brightway2->-r /var/folders/61/vkwks5vs40j9pzn9vtzdt0bh0000gp/T/pipenv-c7spf7zh-requirements/pipenv-j12qgmub-requirement.txt (line 1)) (2.0.12)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /Users/datascience/.local/share/virtualenvs/recovo-VTYhDz3q/lib/python3.10/site-packages (from requests->brightway2->-r /var/folders/61/vkwks5vs40j9pzn9vtzdt0bh0000gp/T/pipenv-c7spf7zh-requirements/pipenv-j12qgmub-requirement.txt (line 1)) (1.26.9)
Requirement already satisfied: idna<4,>=2.5 in /Users/datascience/.local/share/virtualenvs/recovo-VTYhDz3q/lib/python3.10/site-packages (from requests->brightway2->-r /var/folders/61/vkwks5vs40j9pzn9vtzdt0bh0000gp/T/pipenv-c7spf7zh-requirements/pipenv-j12qgmub-requirement.txt (line 1)) (3.3)
Collecting Werkzeug>=2.0
Using cached Werkzeug-2.1.1-py3-none-any.whl (224 kB)
Collecting click>=8.0
Using cached click-8.1.2-py3-none-any.whl (96 kB)
Collecting Jinja2>=3.0
Using cached Jinja2-3.1.1-py3-none-any.whl (132 kB)
Collecting itsdangerous>=2.0
Using cached itsdangerous-2.1.2-py3-none-any.whl (15 kB)
Collecting MarkupSafe>=2.0
Using cached MarkupSafe-2.1.1-cp310-cp310-macosx_10_9_x86_64.whl (13 kB)
Requirement already satisfied: six<2.0,>=1.6.1 in /Users/datascience/.local/share/virtualenvs/recovo-VTYhDz3q/lib/python3.10/site-packages (from astunparse->bw2parameters>=0.6.5->brightway2->-r /var/folders/61/vkwks5vs40j9pzn9vtzdt0bh0000gp/T/pipenv-c7spf7zh-requirements/pipenv-j12qgmub-requirement.txt (line 1)) (1.16.0)
Requirement already satisfied: wheel<1.0,>=0.23.0 in /Users/datascience/.local/share/virtualenvs/recovo-VTYhDz3q/lib/python3.10/site-packages (from astunparse->bw2parameters>=0.6.5->brightway2->-r /var/folders/61/vkwks5vs40j9pzn9vtzdt0bh0000gp/T/pipenv-c7spf7zh-requirements/pipenv-j12qgmub-requirement.txt (line 1)) (0.37.1)
Collecting pillow>=6.2.0
Using cached Pillow-9.1.0-cp310-cp310-macosx_10_9_x86_64.whl (3.1 MB)
Requirement already satisfied: python-dateutil>=2.7 in /Users/datascience/.local/share/virtualenvs/recovo-VTYhDz3q/lib/python3.10/site-packages (from matplotlib->bw2analyzer<0.10.99->brightway2->-r /var/folders/61/vkwks5vs40j9pzn9vtzdt0bh0000gp/T/pipenv-c7spf7zh-requirements/pipenv-j12qgmub-requirement.txt (line 1)) (2.8.2)
Collecting kiwisolver>=1.0.1
Using cached kiwisolver-1.4.2-cp310-cp310-macosx_10_9_x86_64.whl (65 kB)
Requirement already satisfied: pyparsing>=2.2.1 in /Users/datascience/.local/share/virtualenvs/recovo-VTYhDz3q/lib/python3.10/site-packages (from matplotlib->bw2analyzer<0.10.99->brightway2->-r /var/folders/61/vkwks5vs40j9pzn9vtzdt0bh0000gp/T/pipenv-c7spf7zh-requirements/pipenv-j12qgmub-requirement.txt (line 1)) (3.0.8)
Requirement already satisfied: packaging>=20.0 in /Users/datascience/.local/share/virtualenvs/recovo-VTYhDz3q/lib/python3.10/site-packages (from matplotlib->bw2analyzer<0.10.99->brightway2->-r /var/folders/61/vkwks5vs40j9pzn9vtzdt0bh0000gp/T/pipenv-c7spf7zh-requirements/pipenv-j12qgmub-requirement.txt (line 1)) (21.3)
Collecting cycler>=0.10
Using cached cycler-0.11.0-py3-none-any.whl (6.4 kB)
Collecting fonttools>=4.22.0
Using cached fonttools-4.32.0-py3-none-any.whl (900 kB)
Collecting pyxlsb
Using cached pyxlsb-1.0.9-py2.py3-none-any.whl (23 kB)
Collecting pathlib
Using cached pathlib-1.0.1.tar.gz (49 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'error'

error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [1 lines of output]
ERROR: Can not execute setup.py since setuptools is not available in the build environment.
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

This is likely caused by a bug in brightway2. Report this to its maintainers.
✘ Installation Failed

Installation as a requirement via pip fails - incompatible version of bw2io

Original report by James Joyce (Bitbucket: pjamesjoyce, GitHub: pjamesjoyce).


The version of bw2io on PyPi (0.5.12) is different from the version on anaconda cloud (0.6.RC5).

v0.5.12 tries to import database_parameters from bw2data, which it can't do, so loading brightway2 installed via pip throws an import error.

I know the recommended installation is via conda, but I'm writing an extension for lcopt (for parsing hand drawn flow diagrams into lcopt/brightway models) called lcopt-cv and one of the computer vision dependencies is only avaliable on PyPi (as a wheel so it can't be conda skeletoned). I was trying to include brightway in the setup.py install_requires list so it could have a one-step install when I noticed the problem.

Low priority - it's an edge case, and installing most things via conda and then installing something extra via pip isn't a big deal - but figured you might want to know.

Conceptual inconsistencies with activities/products and exchanges in ecoinvent

Original report by Chris Mutel (Bitbucket: cmutel, GitHub: cmutel).


Current importing does not really make sense - all links are from activities to activities, and flows or reference products are only considered as metadata of an activity. However, a reference product has a different name than an activity, and therefore we can easily get confused writing e.g. exporters.

The current system works, and the calculations are OK, but maybe we want to consider being more explicit or better documenting the current assumptions that more or less disregard product names in exchanges.

Excel Importer

Hello all!

When using the activity browser an issue has come up when importing excel databases. In windows this error manifests itself as a peewee error, while in GNU/Linux pointer and segmentation errors are common although not consistently so.

This issue is duplicated in the activity browser and more details can be found there.
LCA-ActivityBrowser/activity-browser#858 (comment)

A typical Linux error message is as follows:
Applying strategy: hash_parameter_group Applying strategy: convert_activity_parameters_to_list Applied 19 strategies in 16.90 seconds Could not link exchanges, here are 10 examples.: [{'amount': 0.00262, 'database': 'super_ei38_REMIND_el_20220923', free(): invalid pointer

Importing US LCI database in xml format

Hey,

I am pretty new to bw2 as well as python so this issue might be easy to solve or I might be committing an obvious mistake.

I am trying to import a new database into bw2, I got the database here: https://github.com/uslci-admin/uslci-content/blob/dev/docs/release_info/release-downloads.md
I downloaded it in the ecospold2 format (because I thought, this is the easiest for me??) and then used the following code in Jupyter notebook to try to import it:

`path = r"/Users/.../EcoSpold01"
useeio = bw.SingleOutputEcospold2Importer(path, 'USeeio')
useeio.apply_strategies()
useeio.statistics()
useeio.write_database()

useeio = bw.Database("USeeio")`

After running this, I get the following error:

Extracting XML data from 0 datasets
Extracted 0 datasets in 0.12 seconds
Applying strategy: normalize_units
Applying strategy: update_ecoinvent_locations
Applying strategy: remove_zero_amount_coproducts
Applying strategy: remove_zero_amount_inputs_with_no_activity
Applying strategy: remove_unnamed_parameters
Applying strategy: es2_assign_only_product_with_amount_as_reference_product
Applying strategy: assign_single_product_as_activity
Applying strategy: create_composite_code
Applying strategy: drop_unspecified_subcategories
Applying strategy: fix_ecoinvent_flows_pre35
Applying strategy: drop_temporary_outdated_biosphere_flows
Applying strategy: link_biosphere_by_flow_uuid
Applying strategy: link_internal_technosphere_by_composite_code
Applying strategy: delete_exchanges_missing_activity
Applying strategy: delete_ghost_exchanges
Applying strategy: remove_uncertainty_from_negative_loss_exchanges
Applying strategy: fix_unreasonably_high_lognormal_uncertainties
Applying strategy: set_lognormal_loc_value
Applying strategy: convert_activity_parameters_to_list
Applying strategy: add_cpc_classification_from_single_reference_product
Applying strategy: delete_none_synonyms
Applied 21 strategies in 0.00 seconds
0 datasets
0 exchanges
0 unlinked exchanges


WrongDatabase Traceback (most recent call last)
Input In [10], in
3 useeio.apply_strategies()
4 useeio.statistics()
----> 5 useeio.write_database()
7 useeio = bw.Database("USeeio")

File ~/opt/anaconda3/envs/buildingretrofit/lib/python3.9/site-packages/bw2io/importers/base_lci.py:237, in LCIImporter.write_database(self, data, delete_existing, backend, activate_parameters, **kwargs)
233 if {o["database"] for o in data} != {self.db_name}:
234 error = "Activity database must be {}, but {} was also found".format(
235 self.db_name, {o["database"] for o in data}.difference({self.db_name})
236 )
--> 237 raise WrongDatabase(error)
238 if len({o["code"] for o in data}) < len(data):
239 seen, duplicates = set(), []

WrongDatabase: Activity database must be USeeio, but set() was also found

I don't know, what I am doing wrong, if I am even using an appropriate approach. Any help on how to import this specific database would be greatly appreciated.
Thank you!

Kernel dies at Package Import on Mac M1

Following the installation instructions (tried both "Quickstart" and "Installation on Mac M1"), my kernel dies when importing any package:

from matplotlib import pyplot as plt

returns

The Kernel crashed while executing code in the the current cell or a previous cell. Please review the code in the cell(s) to identify a possible cause of the failure. Click here for more info. View Jupyter log for further details.

The logs read

info 13:1:58.641: Execute Cell 2 /Users/michaelweinold/github/brightway2/notebooks/Systematic bias in Monte Carlo medians.ipynb
error 13:2:12.291: Error in waiting for cell to complete [Error: Canceled future for execute_request message before replies were done
	at a.KernelShellFutureHandler.dispose (/Users/michaelweinold/.vscode/extensions/ms-toolsai.jupyter-2022.6.1101950301/out/node_modules/@jupyterlab/services.js:2:32353)
	at /Users/michaelweinold/.vscode/extensions/ms-toolsai.jupyter-2022.6.1101950301/out/node_modules/@jupyterlab/services.js:2:26572
	at Map.forEach (<anonymous>)
	at y._clearKernelState (/Users/michaelweinold/.vscode/extensions/ms-toolsai.jupyter-2022.6.1101950301/out/node_modules/@jupyterlab/services.js:2:26557)
	at /Users/michaelweinold/.vscode/extensions/ms-toolsai.jupyter-2022.6.1101950301/out/node_modules/@jupyterlab/services.js:2:29000
	at processTicksAndRejections (node:internal/process/task_queues:96:5)]
warn 13:2:12.291: Cell completed with errors {
  message: 'Canceled future for execute_request message before replies were done'
}
info 13:2:12.291: Cancel all remaining cells true || Error || undefined
info 13:2:12.291: Cancel pending cells
info 13:2:12.291: Cell 2 executed with state Error

System: macOS Monterey, 12.4 (21F79)
conda 4.13.0

Error in process parallelization while importing ecoinvent database

Original report by Anonymous.


I just installed brightway2 and I am trying to import the ecoinvent 3.5 database. I'm using the lines from the "how to get started" notebook:

from brightway2 import *

create project

projects.set_current("ecoinvent-import")

load ecoinvent db

ei35default = SingleOutputEcospold2Importer(
r"C:\Users\name\Desktop\LCA\resources\ecoinvent v3.5\APOS\datasets",
"ecoinvent 3.5 APOS"
)

The code starts and shows a message:

Extracting XML data from 16045 datasets

Shortly after the following error pops up:

File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\multiprocessing\process.py", line 105, in start
self._popen = self._Popen(self)

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.

The code keeps running, showing the same error over and over again. I let it run for an hour, then I aborted. There seems to be some problem with the parallelization. Any ideas on how to fix it?

I am using Python 3.6 in the Pycharm IDE on Windows.

pyprind causing problems in various contexts

Original report by Pascal Lesage (Bitbucket: MPa, ).


The use of pyprind can generate errors in certain contexts, limiting the use of Brightway2 as a backend engine.
Example:

  • use on a calculation cluster, pyprind results in a "No valid output stream.", and blocks all calculations.
  • for use in a GUI with no terminal (e.g. running with pythonw), similar issue.

Unable to install brightway2 using conda

Installation according to documentation:

conda create -n bw2 -c conda-forge -c cmutel brightway2 jupyterlab

returns

Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: \ 
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed                                                                                                     

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versions

Package openssl conflicts for:
jupyterlab -> python[version='>=3.7'] -> openssl[version='>=1.1.1g,<1.1.2a|>=1.1.1h,<1.1.2a|>=1.1.1i,<1.1.2a|>=1.1.1j,<1.1.2a|>=1.1.1l,<1.1.2a|>=1.1.1n,<1.1.2a|>=1.1.1o,<1.1.2a|>=3.0.3,<4.0a0|>=3.0.2,<4.0a0|>=3.0.0,<4.0a0|>=1.1.1m,<1.1.2a|>=1.1.1k,<1.1.2a']
brightway2 -> python[version='>=3.9'] -> openssl[version='>=1.1.1g,<1.1.2a|>=1.1.1h,<1.1.2a|>=1.1.1i,<1.1.2a|>=1.1.1j,<1.1.2a|>=1.1.1l,<1.1.2a|>=1.1.1n,<1.1.2a|>=1.1.1o,<1.1.2a|>=3.0.3,<4.0a0|>=3.0.2,<4.0a0|>=3.0.0,<4.0a0|>=1.1.1m,<1.1.2a|>=1.1.1k,<1.1.2a']

Package python conflicts for:
brightway2 -> asteval[version='>=0.9.22'] -> python[version='3.9.*|>=3.10,<3.11.0a0|>=3.10,<3.11.0a0|>=3.6|>=3.7|>=3.8,<3.9.0a0|>=3.8,<3.9.0a0|>=3.9,<3.10.0a0|>=3.9,<3.10.0a0|>=3.6,<4.0|>=3.6,<3.9|>=3.4|>=2.7',build=*_cpython]
brightway2 -> python[version='>=3.9']

Package requests conflicts for:
brightway2 -> bw2data[version='>=3.6.2'] -> requests[version='>=2.25']
brightway2 -> requests

Package python_abi conflicts for:
brightway2 -> bw2analyzer[version='<0.10.99'] -> python_abi[version='3.10.*|3.7.*|3.8.*',build='*_cp38|*_cp310|*_cp37m']
brightway2 -> python_abi=3.9[build=*_cp39]

Installing just brightway2 into an arbitrary conda environment:

(bw2) michaelweinold@Michaels-MBP ~ % conda install -c cmutel brightway2

returns

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: \ 
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed                                                                                                     

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versions

System: macOS Monterey, 12.4 (21F79)
conda 4.13.0

Unlinked exchanges with ecoinvent

Hi,

I am having some issues with uploading my own databases linked to ecoinvent into different bw2 settings.
I will post below the different notifications, I get. All scripts are running perfectly fine on other computers. So it is not a mistake in the excel sheets itself.

  1. I have a script which searches for an activity in ecoinvent based on the activity code in an excel file.
    image
    I have last run this in an environment with python 3.9. I also tried an environment with Python 3.8 which gives me the same error.
    image

  2. I tried importing an excel file with the ExcelImporter into a Jupyter Notebook to create my own database. It gives me an error of unlinked exchanges. I also tried this in an environment with python 3.8 and python 3.9.
    image

  3. I tried to import the same excel file as a database in the activity browser.
    I am using an environment with python3.8 because with python 3.9 the ab isn't opening.
    image
    image
    image

Could you please help me find out what the underlying problem might be?

Thanks in advance!
Jana

SimaPro export fail match with ecoinvent

Hello again,

After the bug from #26, I tried to simply remove all parameters by using the option "Convert expression to constants" when exporting with SimaPro. The import works properly:

image

but this time it's the matching with ecoinvent3.6 cut-off that seems to fail. Even though, it's supposed to be run with calling .strategies() I specifically call sp.match_database("ecoinvent3.6 cut-off", ignore_categories=True). Yet I still have unlinked exchanges:

image

and the unlinked processes are actual processes from ecoinvent3.6 cut-off, e.g :

image

Could the matching be failing because the name of the process is the "SimaPro-name" (let's call it like that), which means in the screenshot above: 'Transport, freight, lorry >32 metric ton, euro5 {RoW}| market for transport, freight, lorry >32 metric ton, EURO5 | Cut-off, U', while in ecoinvent3.6 cut-off in my AB/brightway2 the name of the process would be something like 'Transport, freight, lorry >32 metric ton, euro5'?

I'm assuming dealing with this different nomenclature is a core concept to the SimaProCSVImporter class, so I guess it must be broken somehow because of an update from SimaPro or whatnot

If needed I can provide the Excel export files.

Help with uncertainty (Monte Carlo Analysis)

Hello, I have been using brightway2 for some time now and am trying to perform MC analysis. What I intend to do is use the uncertainty values already provided in Ecoinvent3.6 and perform LCA and LCIA calculations. I have tried to look at some tutorials but haven't found anything helpful. Many tutorials have broken links where I am not able to find the files needed for using the tutorial. Can someone kindly point me to a tutorial for performing MC analysis using the uncertainty data in ecoinvent. I want to keep my final demand, my LCIA method fixed and just analyze the uncertainty in the background data.

Apologies for posting this as an issue.

Cannot change exchange amount

Original report by Anonymous.


I'm using brightway2 with miniconda in PyCharm IDE on Windows OS. I am trying to change the amount of an exchange, however my change is not being executed. I get no errors, the number simply does not change.

Sample code:

oActivity = bw.Database('some_db').search("some_activity")[0]
oExchange = list(oActivity.exchanges())[1]
oExchange["amount"]

0
oExchange["amount"] = 1
oExchange["amount"]
0

Brightway2 LCIA method (ILCD 2018) is missing

I recently installed bw2 and the activity-browser and imported 975 LCIA methods, but the ILCD 2018 method is missing. My colleague has installed bw2 a few months ago and he can use the ILCD 2018 methods, even though installed in the same way. I reinstalled bw2 using the brightway2 recipe from @BenPortner in jupyter lab, but the ILCD 2018 is still missing.
Is there a way to integrate the ILCD 2018 methods to bw2 and the activity browser or is there a reason why they are not included anymore?

Thanks in advance!

Adrian

'Projects' is not defined

Original report by Anonymous.


Dear Chris,

thanks alot for the efforts invested in Brightway. I am currently trying to set it up for
an analysis of Ecoinvent2 and wanted to follow your descriptions for importing Ecoinvent, but I got stuck at trying to set the 'projects.current' . It throws the error you see in the attached image.
I use Anaconda Python on Windows 7 and also have set the data directory using a 'brightway2path.txt' variable in my home directory.

Thanks and best regards,
Nikolaj

Importing own LCIA Method

Hi,

I have a Simapro CSV export file with an LCIA method and related characterisation factors. Is it possible to import this in BW and subsequently use it in the activity browser? Can anyone please help?

Unfortunately, I find it difficult to follow the instructions provided in the BW documentation.

Best,
Abdur

Biosphere3 version made clear

[Nice to have]

As an LCIA method "operationalizer" of a method that is not by default implemented in ecoinvent, I think it would be nice to have explicit different versions of biosphere3. When biosphere3 changes (mainly due to a new ecoinvent version coming out) the LCIA method would not work properly with the new version anymore. It would require an update. To make it clear and transparent to users of the LCIA method it would be nice to be able to link any version of the LCIA method to version numbers of elementary flows in bw2.

bw2io.errors.MultiprocessingError

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."""

import brightway2 as bw2data
import bw2analyzer as bwa

# %% Set-up Brightway

bw_project_name = 'my-project'

# If a project with the `bw_project_name` does not exist yet
if bw_project_name not in bw2data.projects:

    bw2data.projects.set_current(bw_project_name)
    bw2data.bw2setup()  # Add elementary flows and LCIA methods

# Import/write ecoinvent database

bw2data.projects.set_current(bw_project_name)

bw_db_name = "ecoinvent39cutoff"

# If a database with the name `bw_db:_name` does not exist yet
if bw_db_name not in bw2data.databases:

    ei = bw2data.SingleOutputEcospold2Importer(
        "./data/ecoinvent-3.9/datasets/",  # Database files
        bw_db_name  # Database name
        )

    ei.apply_strategies()
    ei.statistics()
    ei.write_database()

    print(bw2data.projects)   # Show projects
    print(bw2data.databases)  # Show databases

db_ei39 = bw2data.Database(bw_db_name)  # Load ecoinvent database

del bw_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?

'import brightway2' causes ModuleNotFoundError when Jupyter Notebook uses autoreload magic

To reproduce the error, run in a cell:

%load_ext autoreload
%autoreload 2

# some random imports
import sys
import os
from pathlib import Path
import gzip
import pickle
import configparser

# brightway import
import brightway2 as bw

, which returns

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
File ~/miniconda3/envs/lca_pylcaio/lib/python3.10/site-packages/IPython/extensions/autoreload.py:615, in AutoreloadMagics.post_execute_hook(self)
    613 newly_loaded_modules = set(sys.modules) - self.loaded_modules
    614 for modname in newly_loaded_modules:
--> 615     _, pymtime = self._reloader.filename_and_mtime(sys.modules[modname])
    616     if pymtime is not None:
    617         self._reloader.modules_mtimes[modname] = pymtime

File ~/miniconda3/envs/lca_pylcaio/lib/python3.10/site-packages/IPython/extensions/autoreload.py:193, in ModuleReloader.filename_and_mtime(self, module)
    192 def filename_and_mtime(self, module):
--> 193     if not hasattr(module, "__file__") or module.__file__ is None:
    194         return None, None
    196     if getattr(module, "__name__", None) in [None, "__mp_main__", "__main__"]:
    197         # we cannot reload(__main__) or reload(__mp_main__)

File ~/miniconda3/envs/lca_pylcaio/lib/python3.10/site-packages/eight/utils.py:41, in RedirectingLoader.__getattr__(self, attr)
     39 else:
     40     if self._module is None:
---> 41         self._module = __import__(self._name)
     42     if len(self._moves) == 0:
     43         sys.modules[self._parent_name + '.' + self._name] = sys.modules[self._name]

ModuleNotFoundError: No module named '_dummy_thread'

Conda environment specifications:

Name Version Build Channel

_libgcc_mutex 0.1 conda_forge conda-forge
_openmp_mutex 4.5 2_kmp_llvm conda-forge
anyio 3.6.1 pyhd8ed1ab_1 conda-forge
appdirs 1.4.4 pyh9f0ad1d_0 conda-forge
argon2-cffi 21.3.0 pyhd8ed1ab_0 conda-forge
argon2-cffi-bindings 21.2.0 py310h5764c6d_2 conda-forge
asteval 0.9.27 pyhd8ed1ab_0 conda-forge
asttokens 2.0.8 pyhd8ed1ab_0 conda-forge
astunparse 1.6.3 pyhd8ed1ab_0 conda-forge
attrs 22.1.0 pyh71513ae_1 conda-forge
babel 2.10.3 pyhd8ed1ab_0 conda-forge
backcall 0.2.0 pyh9f0ad1d_0 conda-forge
backports 1.0 py_2 conda-forge
backports.functools_lru_cache 1.6.4 pyhd8ed1ab_0 conda-forge
beautifulsoup4 4.11.1 pyha770c72_0 conda-forge
bleach 5.0.1 pyhd8ed1ab_0 conda-forge
brightway2 2.4.2 py_5 cmutel
brotli 1.0.9 h166bdaf_7 conda-forge
brotli-bin 1.0.9 h166bdaf_7 conda-forge
brotlipy 0.7.0 py310h5764c6d_1004 conda-forge
bw2agg 0.1.2 pypi_0 pypi
bw2analyzer 0.10 py_1 cmutel
bw2calc 1.8.1 py_2 cmutel
bw2data 3.6.5 py_0 cmutel
bw2io 0.8.6 py_1 cmutel
bw2parameters 0.7 py_0 cmutel
bw_migrations 0.1 py_0 cmutel
bzip2 1.0.8 h7f98852_4 conda-forge
c-ares 1.18.1 h7f98852_0 conda-forge
ca-certificates 2022.6.15 ha878542_0 conda-forge
cached-property 1.5.2 hd8ed1ab_1 conda-forge
cached_property 1.5.2 pyha770c72_1 conda-forge
certifi 2022.6.15 py310hff52083_0 conda-forge
cffi 1.15.1 py310h255011f_0 conda-forge
charset-normalizer 2.1.0 pyhd8ed1ab_0 conda-forge
cryptography 37.0.4 py310h597c629_0 conda-forge
curl 7.83.1 h7bff187_0 conda-forge
cycler 0.11.0 pyhd8ed1ab_0 conda-forge
debugpy 1.6.3 py310hd8f1fbe_0 conda-forge
decorator 5.1.1 pyhd8ed1ab_0 conda-forge
defusedxml 0.7.1 pyhd8ed1ab_0 conda-forge
docopt 0.6.2 py_1 conda-forge
docutils 0.19 py310hff52083_0 conda-forge
ecospold2matrix 0.2.0.dev0 pypi_0 pypi
eight 1.0.0 py_0 conda-forge
entrypoints 0.4 pyhd8ed1ab_0 conda-forge
et_xmlfile 1.0.1 py_1001 conda-forge
executing 0.10.0 pyhd8ed1ab_0 conda-forge
expat 2.4.8 h27087fc_0 conda-forge
fasteners 0.17.3 pyhd8ed1ab_0 conda-forge
flit-core 3.7.1 pyhd8ed1ab_0 conda-forge
fonttools 4.36.0 py310h5764c6d_0 conda-forge
freetype 2.12.1 hca18f0e_0 conda-forge
future 0.18.2 py310hff52083_5 conda-forge
gettext 0.19.8.1 h73d1719_1008 conda-forge
git 2.37.2 pl5321h36853c3_1 conda-forge
h5py 3.7.0 nompi_py310h416281c_101 conda-forge
hdf5 1.12.2 nompi_h2386368_100 conda-forge
icu 70.1 h27087fc_0 conda-forge
idna 3.3 pyhd8ed1ab_0 conda-forge
importlib-metadata 4.11.4 py310hff52083_0 conda-forge
importlib_metadata 4.11.4 hd8ed1ab_0 conda-forge
importlib_resources 5.9.0 pyhd8ed1ab_0 conda-forge
ipykernel 6.15.1 pyh210e3f2_0 conda-forge
ipython 8.4.0 py310hff52083_0 conda-forge
ipython_genutils 0.2.0 py_1 conda-forge
jedi 0.18.1 pyhd8ed1ab_2 conda-forge
jinja2 3.1.2 pyhd8ed1ab_1 conda-forge
jpeg 9e h166bdaf_2 conda-forge
json5 0.9.5 pyh9f0ad1d_0 conda-forge
jsonschema 4.9.1 pyhd8ed1ab_0 conda-forge
jupyter_client 7.3.4 pyhd8ed1ab_0 conda-forge
jupyter_core 4.11.1 py310hff52083_0 conda-forge
jupyter_server 1.18.1 pyhd8ed1ab_0 conda-forge
jupyterlab 3.4.5 pyhd8ed1ab_0 conda-forge
jupyterlab_pygments 0.2.2 pyhd8ed1ab_0 conda-forge
jupyterlab_server 2.15.0 pyhd8ed1ab_0 conda-forge
keyutils 1.6.1 h166bdaf_0 conda-forge
kiwisolver 1.4.4 py310hbf28c38_0 conda-forge
krb5 1.19.3 h3790be6_0 conda-forge
lcms2 2.12 hddcbb42_0 conda-forge
ld_impl_linux-64 2.36.1 hea4e1c9_2 conda-forge
lerc 4.0.0 h27087fc_0 conda-forge
libblas 3.9.0 16_linux64_mkl conda-forge
libbrotlicommon 1.0.9 h166bdaf_7 conda-forge
libbrotlidec 1.0.9 h166bdaf_7 conda-forge
libbrotlienc 1.0.9 h166bdaf_7 conda-forge
libcblas 3.9.0 16_linux64_mkl conda-forge
libcurl 7.83.1 h7bff187_0 conda-forge
libdeflate 1.13 h166bdaf_0 conda-forge
libedit 3.1.20191231 he28a2e2_2 conda-forge
libev 4.33 h516909a_1 conda-forge
libffi 3.4.2 h7f98852_5 conda-forge
libgcc-ng 12.1.0 h8d9b700_16 conda-forge
libgfortran-ng 12.1.0 h69a702a_16 conda-forge
libgfortran5 12.1.0 hdcd56e2_16 conda-forge
libiconv 1.16 h516909a_0 conda-forge
liblapack 3.9.0 16_linux64_mkl conda-forge
libnghttp2 1.47.0 hdcd2b5c_1 conda-forge
libnsl 2.0.0 h7f98852_0 conda-forge
libpng 1.6.37 h753d276_4 conda-forge
libsodium 1.0.18 h36c2ea0_1 conda-forge
libsqlite 3.39.2 h753d276_1 conda-forge
libssh2 1.10.0 haa6b8db_3 conda-forge
libstdcxx-ng 12.1.0 ha89aaad_16 conda-forge
libtiff 4.4.0 h0e0dad5_3 conda-forge
libuuid 2.32.1 h7f98852_1000 conda-forge
libwebp-base 1.2.4 h166bdaf_0 conda-forge
libxcb 1.13 h7f98852_1004 conda-forge
libxml2 2.9.14 h22db469_4 conda-forge
libxslt 1.1.35 h8affb1d_0 conda-forge
libzlib 1.2.12 h166bdaf_2 conda-forge
llvm-openmp 14.0.4 he0ac6c6_0 conda-forge
lxml 4.9.1 py310h5764c6d_0 conda-forge
markupsafe 2.1.1 py310h5764c6d_1 conda-forge
matplotlib-base 3.5.3 py310h5701ce4_1 conda-forge
matplotlib-inline 0.1.5 pyhd8ed1ab_0 conda-forge
mistune 0.8.4 py310h6acc77f_1005 conda-forge
mkl 2022.1.0 h84fe81f_915 conda-forge
mrio_common_metadata 0.2.1 py_0 cmutel
munkres 1.1.4 pyh9f0ad1d_0 conda-forge
nbclassic 0.4.3 pyhd8ed1ab_0 conda-forge
nbclient 0.6.6 pyhd8ed1ab_0 conda-forge
nbconvert 6.5.3 pyhd8ed1ab_0 conda-forge
nbconvert-core 6.5.3 pyhd8ed1ab_0 conda-forge
nbconvert-pandoc 6.5.3 pyhd8ed1ab_0 conda-forge
nbformat 5.4.0 pyhd8ed1ab_0 conda-forge
ncurses 6.3 h27087fc_1 conda-forge
nest-asyncio 1.5.5 pyhd8ed1ab_0 conda-forge
nose 1.3.7 pypi_0 pypi
notebook 6.4.12 pyha770c72_0 conda-forge
notebook-shim 0.1.0 pyhd8ed1ab_0 conda-forge
numpy 1.23.2 py310h53a5b5f_0 conda-forge
openjpeg 2.5.0 h7d73246_1 conda-forge
openpyxl 3.0.9 pyhd8ed1ab_0 conda-forge
openssl 1.1.1q h166bdaf_0 conda-forge
packaging 21.3 pyhd8ed1ab_0 conda-forge
pandas 1.4.3 py310h769672d_0 conda-forge
pandoc 2.19 ha770c72_0 conda-forge
pandocfilters 1.5.0 pyhd8ed1ab_0 conda-forge
parso 0.8.3 pyhd8ed1ab_0 conda-forge
pcre2 10.37 hc3806b6_1 conda-forge
peewee 3.15.1 py310hba2f8c6_0 conda-forge
perl 5.32.1 2_h7f98852_perl5 conda-forge
pexpect 4.8.0 pyh9f0ad1d_2 conda-forge
pickleshare 0.7.5 py_1003 conda-forge
pillow 9.2.0 py310hbd86126_2 conda-forge
pip 22.2.2 pyhd8ed1ab_0 conda-forge
pkgutil-resolve-name 1.3.10 pyhd8ed1ab_0 conda-forge
prometheus_client 0.14.1 pyhd8ed1ab_0 conda-forge
prompt-toolkit 3.0.30 pyha770c72_0 conda-forge
psutil 5.9.1 py310h5764c6d_0 conda-forge
pthread-stubs 0.4 h36c2ea0_1001 conda-forge
ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge
pure_eval 0.2.2 pyhd8ed1ab_0 conda-forge
pycparser 2.21 pyhd8ed1ab_0 conda-forge
pygments 2.13.0 pyhd8ed1ab_0 conda-forge
pymrio 0.4.7 pyhd8ed1ab_0 conda-forge
pyopenssl 22.0.0 pyhd8ed1ab_0 conda-forge
pypardiso 0.4.1 pyhd8ed1ab_0 conda-forge
pyparsing 3.0.9 pyhd8ed1ab_0 conda-forge
pyprind 2.11.2 py310hff52083_1003 conda-forge
pyrsistent 0.18.1 py310h5764c6d_1 conda-forge
pysocks 1.7.1 py310hff52083_5 conda-forge
python 3.10.5 h582c2e5_0_cpython conda-forge
python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge
python-fastjsonschema 2.16.1 pyhd8ed1ab_0 conda-forge
python_abi 3.10 2_cp310 conda-forge
pytz 2022.2.1 pyhd8ed1ab_0 conda-forge
pyxlsb 1.0.9 pyhd8ed1ab_0 conda-forge
pyzmq 23.2.1 py310h330234f_0 conda-forge
readline 8.1.2 h0f457ee_0 conda-forge
requests 2.28.1 pyhd8ed1ab_0 conda-forge
scipy 1.9.0 py310hdfbd76f_0 conda-forge
send2trash 1.8.0 pyhd8ed1ab_0 conda-forge
setuptools 65.0.2 py310hff52083_0 conda-forge
setuptools-scm 7.0.5 pyhd8ed1ab_0 conda-forge
six 1.16.0 pyh6c4a22f_0 conda-forge
sniffio 1.2.0 py310hff52083_3 conda-forge
soupsieve 2.3.2.post1 pyhd8ed1ab_0 conda-forge
sqlite 3.39.2 h4ff8645_1 conda-forge
stack_data 0.4.0 pyhd8ed1ab_0 conda-forge
stats_arrays 0.6.5 pyhd8ed1ab_0 conda-forge
tabulate 0.8.10 pyhd8ed1ab_0 conda-forge
tbb 2021.5.0 h924138e_1 conda-forge
terminado 0.15.0 py310hff52083_0 conda-forge
tinycss2 1.1.1 pyhd8ed1ab_0 conda-forge
tk 8.6.12 h27826a3_0 conda-forge
tomli 2.0.1 pyhd8ed1ab_0 conda-forge
tornado 6.2 py310h5764c6d_0 conda-forge
traitlets 5.3.0 pyhd8ed1ab_0 conda-forge
typing-extensions 4.3.0 hd8ed1ab_0 conda-forge
typing_extensions 4.3.0 pyha770c72_0 conda-forge
tzdata 2022c h191b570_0 conda-forge
unicodecsv 0.14.1 py_1 conda-forge
unicodedata2 14.0.0 py310h5764c6d_1 conda-forge
unidecode 1.3.4 pyhd8ed1ab_0 conda-forge
urllib3 1.26.11 pyhd8ed1ab_0 conda-forge
voluptuous 0.13.1 pyhd8ed1ab_0 conda-forge
wcwidth 0.2.5 pyh9f0ad1d_2 conda-forge
webencodings 0.5.1 py_1 conda-forge
websocket-client 1.3.3 pyhd8ed1ab_0 conda-forge
wheel 0.37.1 pyhd8ed1ab_0 conda-forge
whoosh 2.7.4 py310hff52083_6 conda-forge
wrapt 1.14.1 py310h5764c6d_0 conda-forge
xlrd 2.0.1 pyhd8ed1ab_3 conda-forge
xlsxwriter 3.0.3 pyhd8ed1ab_0 conda-forge
xlwt 1.3.0 pypi_0 pypi
xorg-libxau 1.0.9 h7f98852_0 conda-forge
xorg-libxdmcp 1.1.3 h7f98852_0 conda-forge
xz 5.2.6 h166bdaf_0 conda-forge
zeromq 4.3.4 h9c3ff4c_1 conda-forge
zipp 3.8.1 pyhd8ed1ab_0 conda-forge
zstd 1.5.2 h6239696_4 conda-forge

Correct way to do activity-level LCIA

Hey there @cmutel and co. I'm really enjoying your tool. Such a game-changer. Keep it up :)

In my case, I'm using Brightway2 to load Ecoinvent 3.8 data. I then want to run LCA to obtain scores for a subset of methods. I have 19565 activities. It's taking me roughly 24 hours to cover all the activities.

Am I doing something wrong? My usecase is very simple: I just need the score for one functional unit of each activity. So I'm wondering if I missed something. For instance maybe these activity-level LCIA values might be precomputed and available somewhere.

Here is the crux of my code:

import tqdm

lcias = {}

for activity in tqdm.tqdm(eidb):
    for method in [('CML 2001 (superseded)', 'climate change', 'GWP 20a')]:
        functional_unit = {activity: 1}
        lca = bw.LCA(functional_unit, method)
        lca.lci()
        lca.lcia()
        lcias[activity.key[1]] = {method: lca.score}

I noticed the switch and redo_* methods, but they don't save any computation time, on the contrary:

import tqdm

lcias = {}
lca = None

for activity in tqdm.tqdm(eidb):
    for method in [('CML 2001 (superseded)', 'climate change', 'GWP 20a')]:
        functional_unit = {activity: 1}
        if lca is None:
            lca = bw.LCA(functional_unit, method)
            lca.lci()
            lca.lcia()
        else:
            lca.switch_method(method)
            lca.redo_lci(functional_unit)
            lca.redo_lcia(functional_unit)

        lcias[activity.key[1]] = {method: lca.score}

Kind regards.

Ecoinvent local import: .WrongDatabase: Activity database must be ecoinvent39, but set() was also found

Hello everyone,

I am trying to get started doing automated LCA using the ecoinvent 3.9 database, Brightway2 2.4.2 and Python (3.10). I'm not very knowledgeable yet so please bear with me. I am trying to import ecoinvent and write it to a regular Brightway2 database like so:

from pathlib import Path
from brightway2 import *

projects.set_current("TestEcoinventImport")
pte = Path("C:\\") / "Users" / "Joshua Schroijen" / "ecoinvent" / "ecoinvent 3.9_cutoff_ecoSpold02"
print(pte)
importer = SingleOutputEcospold2Importer(pte, "ecoinvent39")
importer.apply_strategies()
db = importer.write_database()

But this code snippet gives me the following exception on the last line:

Traceback (most recent call last):
  File "C:\Users\Joshua Schroijen\leaf-backend\business_logic\ecoinvent.py", line 9, in <module>
    db = importer.write_database()
  File "C:\Users\Joshua Schroijen\.conda\envs\bw2\lib\site-packages\bw2io\importers\base_lci.py", line 237, in write_database
    raise WrongDatabase(error)
bw2io.errors.WrongDatabase: Activity database must be ecoinvent39, but set() was also found

I will include all of the output of the snippet at the end of this post.

In other words, it seems like importing ecoinvent 3.9 locally doesn't work. From the documentation I can't infer that I am missing something. People using the Activity Browser are recommended to import ecoinvent by downloading it. But I don't want to use the Activity Browser (since I'm experimenting with LCA automation) and don't want to have to download this pretty big database every time (not to mention have the cybersecurity implications of doing so, since ecoinvent requires credentials). Is this an ecoinvent data format issue or a Brightway2 issue? I'm erring on the first, but in the snippet output I also see the message "Extracting XML data from 0 datasets", which I find odd since there very much is a lot of data in the directory I'm pointing the script at. I would appreciate any suggestions for a workaround. Am I missing something? Is this something that will be fixed or is easily fixable with the right trick?

Thanks a lot in advance for your help and input!

Joshua Schroijen

Complete snippet output:

Extracting XML data from 0 datasets
Extracted 0 datasets in 0.04 seconds
Applying strategy: normalize_units
Applying strategy: update_ecoinvent_locations
Applying strategy: remove_zero_amount_coproducts
Applying strategy: remove_zero_amount_inputs_with_no_activity
Applying strategy: remove_unnamed_parameters
Applying strategy: es2_assign_only_product_with_amount_as_reference_product
Applying strategy: assign_single_product_as_activity
Applying strategy: create_composite_code
Applying strategy: drop_unspecified_subcategories
Applying strategy: fix_ecoinvent_flows_pre35
C:\Users\Joshua Schroijen\.conda\envs\bw2\lib\site-packages\bw2io\strategies\ecospold2.py:246: UserWarning: Skipping migration 'fix-ecoinvent-flows-pre-35' because it isn't installed
  warnings.warn(
Applying strategy: drop_temporary_outdated_biosphere_flows
Applying strategy: link_biosphere_by_flow_uuid
Applying strategy: link_internal_technosphere_by_composite_code
Applying strategy: delete_exchanges_missing_activity
Applying strategy: delete_ghost_exchanges
Applying strategy: remove_uncertainty_from_negative_loss_exchanges
Applying strategy: fix_unreasonably_high_lognormal_uncertainties
Applying strategy: set_lognormal_loc_value
Applying strategy: convert_activity_parameters_to_list
Applying strategy: add_cpc_classification_from_single_reference_product
Applying strategy: delete_none_synonyms
Applied 21 strategies in 0.00 seconds
Traceback (most recent call last):
  File "C:\Users\Joshua Schroijen\leaf-backend\business_logic\ecoinvent.py", line 9, in <module>
    db = importer.write_database()
  File "C:\Users\Joshua Schroijen\.conda\envs\bw2\lib\site-packages\bw2io\importers\base_lci.py", line 237, in write_database
    raise WrongDatabase(error)
bw2io.errors.WrongDatabase: Activity database must be ecoinvent39, but set() was also found

Update Brightway2

Original report by Mija Frossard (Bitbucket: mfrossard, GitHub: mfrossard).


When I launch in Anaconda Prompt :

#!Python
conda update Brightway2

It doesn't update and tells me that I have the last version. But this command works :

#!Python
conda update -c cmutel brightway2

You should update the documentation as it says that the first command must be used.

Also does the update of Brightway2 include the update of bw2io and bw2data ? (as there is different command here)

Setting up brightway fails

Hello,

I am trying to set up brightway2 in a new environment but I am experiencing difficulties that I am unable to solve.
Please see below for my complete demand and error history.

Thanks in advance for your help!


System specification:
Windows 10 Pro, 20H2, Python 3.8.5, conda 4.10.1


Command and error history:

(C:\Users\jhusmann\Miniconda3) C:\Users\jhusmann>conda update conda
Collecting package metadata (current_repodata.json): done
Solving environment: done

Package Plan

environment location: C:\Users\jhusmann\Miniconda3

added / updated specs:
- conda

The following packages will be downloaded:

package                    |            build
---------------------------|-----------------
six-1.16.0                 |     pyhd3eb1b0_0          18 KB
------------------------------------------------------------
                                       Total:          18 KB

The following packages will be UPDATED:

six pkgs/main/win-64::six-1.15.0-py38haa9~ --> pkgs/main/noarch::six-1.16.0-pyhd3eb1b0_0

Proceed ([y]/n)? y

Downloading and Extracting Packages
six-1.16.0 | 18 KB | ############################################################################ | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

(C:\Users\jhusmann\Miniconda3) C:\Users\jhusmann>conda create -n ModularLCI python=3.8
Collecting package metadata (current_repodata.json): done
Solving environment: done

Package Plan

environment location: C:\Users\jhusmann\Miniconda3\envs\ModularLCI

added / updated specs:
- python=3.8

The following NEW packages will be INSTALLED:

ca-certificates pkgs/main/win-64::ca-certificates-2021.5.25-haa95532_1
certifi pkgs/main/win-64::certifi-2021.5.30-py38haa95532_0
openssl pkgs/main/win-64::openssl-1.1.1k-h2bbff1b_0
pip pkgs/main/win-64::pip-21.1.2-py38haa95532_0
python pkgs/main/win-64::python-3.8.10-hdbf39b2_7
setuptools pkgs/main/win-64::setuptools-52.0.0-py38haa95532_0
sqlite pkgs/main/win-64::sqlite-3.35.4-h2bbff1b_0
vc pkgs/main/win-64::vc-14.2-h21ff451_1
vs2015_runtime pkgs/main/win-64::vs2015_runtime-14.27.29016-h5e58377_2
wheel pkgs/main/noarch::wheel-0.36.2-pyhd3eb1b0_0
wincertstore pkgs/main/win-64::wincertstore-0.2-py38_0

Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done

To activate this environment, use

$ conda activate ModularLCI

To deactivate an active environment, use

$ conda deactivate

(C:\Users\jhusmann\Miniconda3) C:\Users\jhusmann>conda activate ModularLCI

(ModularLCI) C:\Users\jhusmann>conda install -y -q -c conda-forge -c cmutel -c haasad brightway2 jupyter
Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.
Solving environment: ...working... failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.
Solving environment: ...working...
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versions

Package tzdata conflicts for:
brightway2 -> python -> tzdata
jupyter -> python -> tzdata

Package requests conflicts for:
brightway2 -> bw2data[version='<3.9'] -> requests[version='>=1.1.0']
python=3.8 -> pip -> requests
brightway2 -> requests

(ModularLCI) C:\Users\jhusmann>conda create -n bw38 -c conda-forge -c cmutel -c haasad brightway2 mkl=2020.2 python=3.8
Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: /
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versions

Package mkl conflicts for:
mkl=2020.2
brightway2 -> numpy[version='>=1.20'] -> mkl[version='>=2018.0.0,<2019.0a0|>=2018.0.1,<2019.0a0|>=2018.0.2,<2019.0a0|>=2018.0.3,<2019.0a0|>=2019.1,<2021.0a0|>=2019.3,<2021.0a0|>=2019.4,<2021.0a0|>=2021.2.0,<2022.0a0|>=2019.4,<2020.0a0|>=2019.1,<2020.0a0']

Package python conflicts for:
python=3.8
brightway2 -> python
brightway2 -> asteval[version='>=0.9.22'] -> python[version='2.7.|3.5.|3.6.|>=3.6|>=3.7,<3.8.0a0|>=3.9,<3.10.0a0|>=3.8,<3.9.0a0|3.4.|>=3.5,<3.6.0a0|>=2.7,<2.8.0a0|>=3.6,<3.7.0a0|>=2.7']

Docs on Setting BRIGHTWAY2_DIR in a virtual environment unclear

Original report by Pascal Lesage (Bitbucket: MPa, ).


https://bitbucket.org/cmutel/brightway2/src/60031ebad9a4a7f3317260b5fa3bec3e954bb360/docs/faq.rst?at=default&fileviewer=file-view-default

  1. Both instructions refer to activate.d:

"Inside the folder activate.d create the file whatever_name_you_like.sh and inside it write export BRIGHTWAY2_DIR=/my/custom/directory while in activate.d create whatever_name_you_like.sh and inside write unset BRIGHTWAY2_DIR."

  1. Instructions for Windows incorrect. Beyond changing the file extension, the actual commands should also be changed:

In activate.bat: set BRIGHTWAY2_DIR=Z:\Temporaire\Pascal\temp_bw

In deactivate.bat: BRIGHTWAY2_DIR=

F Infrastructure: documentation

IPCC 2021 for ei39 in Brightway

I do not find any IPCC 2021 methods in existing Brightway for ecoinvent 3.9. Please let me know if needs to be setup. I am going to do it for both ei38 and ei39 and if required I will share.

ecospold2 import fails: no geography

Original report by Benjamin W. Portner (Bitbucket: pommespapst, GitHub: pommespapst).


I am trying to import an ecospold2 file but I get the following error:

Extracting ecospold2 files:
Traceback (most recent call last):
File "", line 4, in
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\bw2io\importers\ecospold2.py", line 62, in init
self.data = extractor.extract(dirpath, db_name)
File "", line 4, in extract
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\bw2io\extractors\ecospold2.py", line 99, in extract
data.append(cls.extract_activity(dirpath, filename, db_name))
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\bw2io\extractors\ecospold2.py", line 135, in extract_activity
stem.activityDescription.geography, "comment"))),
File "src\lxml\objectify.pyx", line 230, in lxml.objectify.ObjectifiedElement.getattr
File "src\lxml\objectify.pyx", line 450, in lxml.objectify._lookupChildOrRaise
AttributeError: no such child: {http://www.EcoInvent.org/EcoSpold02}geography

I attached the .spold file. The error might appear because the file was originally a ILCD file which I converted to ecospold2 using the OpenLCA converter.

Incompatibility brightway / spyder

I wanted to use brightway with spyder in my conda environment.
I encountered an error each time I tried to import the brightway package.

It turned out that it was an incompatibility between spyder and the dependency "eight"
This package seemed to be called when using Python 2, as I always use python 3, I simply deleted every reference to "eight"
After that everything works fine.

Brightway2 Traci method obsolete

I am using the TRACI method in the LCIA methods of Brightway2. The indicators as well as the units are not matching TRACI 2.1 from USEPA. Is there an update that corrects this error?

For example, TRACI in Brightway has photo chemical oxidation, TRACI 2.1 has smog formation with different units. The units of carcinogenics is different as well as ecotoxicity.
is the TRACI method in Brightway2 an earlier version? ( It says obsolete)

https://www.epa.gov/chemical-research/tool-reduction-and-assessment-chemicals-and-other-environmental-impacts-traci

Biosphere flows: Can't properly relate to some of the flows

Hi all

I try to include some biosphere flows into my LCA but have some issues with Activities whose name is only one word. Not sure if that is only a coincidence or correlation though... Here what I am doing (using Jupyter & Python 3.8):

db = bw2.Database('biosphere3')
[act for act in db if 'Ammonia' in act['name']  and 'non-urban air' in str(act['categories'])]
KeyError                                  Traceback (most recent call last)
/var/folders/tf/hzv31v4x42q4_mnw4n8ldhsm0000gn/T/ipykernel_13952/3710977775.py in <module>
----> 1 [act for act in db if 'Ammonia' in act['name'] 
      2                                             and 'non-urban air' in str(act['categories'])]

/var/folders/tf/hzv31v4x42q4_mnw4n8ldhsm0000gn/T/ipykernel_13952/3710977775.py in <listcomp>(.0)
      1 [act for act in db if 'Ammonia' in act['name'] 
----> 2                                             and 'non-urban air' in str(act['categories'])]

~/opt/miniconda3/lib/python3.8/site-packages/bw2data/proxies.py in __getitem__(self, key)
     89         elif key == 1:
     90             return self['code']
---> 91         return self._data[key]
     92 
     93     def __delitem__(self, key):

KeyError: 'categories'

I have established, that the flow exists:
bw2.Database('biosphere3').search('Ammonia', filter={'categories':'air'})

Excluding 1 filtered results
['Ammonia' (kilogram, None, ('air', 'urban air close to ground')),
 'Ammonia' (kilogram, None, ('air', 'lower stratosphere + upper troposphere')),
 'Ammonia' (kilogram, None, ('air',)),
 'Ammonia' (kilogram, None, ('air', 'non-urban air or from high stacks')),
 'Ammonia' (kilogram, None, ('air', 'low population density, long-term'))]

And the above code works with e.g. Carbon dioxide:
[act for act in db if 'Carbon dioxide' in act['name'] and 'non-urban air' in str(act['categories'])]

['Carbon dioxide, from soil or biomass stock' (kilogram, None, ('air', 'non-urban air or from high stacks')),
 'Carbon dioxide, non-fossil' (kilogram, None, ('air', 'non-urban air or from high stacks')),
 'Carbon dioxide, fossil' (kilogram, None, ('air', 'non-urban air or from high stacks'))]

The search worked nicely also for dinitrogen monoxide and nitrogen oxides but resulted in the same error for Phosphorus and Phosphate. Am I missing something?

SimaPro CSV import fails

Hello,

I am trying to transfer a project from SimaPro (v9.1.0.8) to brightway2 (v2.3) through the SimaProCSVImporter class.
My issue is that for some reason, the .csv parser separates the commas even though the .csv file was made with ';' as the separator and that ';' was in the initialization of SimaProCSVImporter (see screenshot below).

image

The csv file viewed in Excel:

image

We can see that it spreads to 3 columns for some reason while in reality there is no ';' at this spot:

image

And if I try to fix it manually, the csv file breaks adding commas everywhere

image

which makes it unusable in brightway2

image

I could not get there (because I can't fix the bug) but the same problem of separators happens with biosphere flows which will probably cause issues down the line as well.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.