Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing EXIOBASE importer, cannot import Exiobase3MonetaryImporter from bw2io #262

Open
nicolnt opened this issue May 31, 2024 · 2 comments

Comments

@nicolnt
Copy link

nicolnt commented May 31, 2024

I am trying to make use of Exiobase3MonetaryImporter specified here https://docs.brightway.dev/en/latest/content/api/bw2io/importers/exiobase3_monetary/index.html

But using this code raises an error.

# Brightway packages
import bw2io
import bw2data
# Brightway type hints
from bw2io import Exiobase3MonetaryImporter

Code inspired from official documentation https://docs.brightway.dev/en/latest/content/examples/brightway-examples/data_import/ecoinvent_import.html#imports

Error message

{
	"name": "ImportError",
	"message": "cannot import name 'Exiobase3MonetaryImporter' from 'bw2io' (/home/nicolas/miniconda3/envs/brightway_example_graph_technosphere/lib/python3.11/site-packages/bw2io/__init__.py)",
	"stack": "---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[1], line 6
      4 import bw2data
      5 # Brightway type hints
----> 6 from bw2io import Exiobase3MonetaryImporter
      7 # import/export
      8 import os

ImportError: cannot import name 'Exiobase3MonetaryImporter' from 'bw2io' (/home/nicolas/miniconda3/envs/brightway_example_graph_technosphere/lib/python3.11/site-packages/bw2io/__init__.py)"
}

Environment

environment.yml

name: brightway_example_graph_technosphere
channels:
  - conda-forge
  - nodefaults
dependencies:
  # core functionality
  - python=3.11
  - ipython
  - jupyterlab
  # life-cycle assessment
  - bw2data
  - bw2calc
  - bw2io

Taken from here: https://docs.brightway.dev/en/latest/_downloads/dbf0aeba6cfd859b9ebebe4dd5a71cc8/ecoinvent_import.yml

Command to create environment

conda env create -f environment.yml && conda activate brightway_example_graph_technosphere

Package versions

@michaelweinold
Copy link
Contributor

Hello there! I will have a look at this next month. Feel free to ping me here if I have not updated the issue by then.

@mfastudillo
Copy link
Contributor

Hi @nicolnt and @michaelweinold

this import should work.

from bw2io.importers.exiobase3_monetary import Exiobase3MonetaryImporter

however, I think #254 is still a problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants