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

Cannot import brightway2 #7320

Closed
LouiseBru opened this issue Apr 10, 2024 · 1 comment
Closed

Cannot import brightway2 #7320

LouiseBru opened this issue Apr 10, 2024 · 1 comment
Labels
bug status:Needs Triage Applied to issues that need triage

Comments

@LouiseBru
Copy link

Hello,

I recently installed Brightway2 with anaconda, and since then, I've been encountering an error when trying to import it. I've never used brightway before.

Here's the error message I'm receiving:


TypeError Traceback (most recent call last)
Cell In[1], line 1
----> 1 import brightway2 as bw

File ~\anaconda3\envs\brightway_\lib\site-packages\brightway2_init_.py:4
2 from bw2data import *
3 from bw2calc import *
----> 4 from bw2io import *
6 version = (2, 4, 6)

File ~\anaconda3\envs\brightway_\lib\site-packages\bw2io_init_.py:76
63 from .data import (
64 add_ecoinvent_33_biosphere_flows,
65 add_ecoinvent_34_biosphere_flows,
(...)
73 get_xlsx_example_filepath,
74 )
75 from .migrations import migrations, Migration, create_core_migrations
---> 76 from .importers import (
77 CSVImporter,
78 CSVLCIAImporter,
79 Ecospold1LCIAImporter,
80 ExcelImporter,
81 ExcelLCIAImporter,
82 MultiOutputEcospold1Importer,
83 SimaProCSVImporter,
84 SimaProLCIACSVImporter,
85 SingleOutputEcospold1Importer,
86 SingleOutputEcospold2Importer,
87 )
88 from .units import normalize_units
89 from .unlinked_data import unlinked_data, UnlinkedData

File ~\anaconda3\envs\brightway_\lib\site-packages\bw2io\importers_init_.py:2
1 # -- coding: utf-8 --
----> 2 from .ecoinvent_lcia import EcoinventLCIAImporter
3 from .ecospold1 import (
4 MultiOutputEcospold1Importer,
5 NoIntegerCodesEcospold1Importer,
6 SingleOutputEcospold1Importer,
7 )
8 from .ecospold1_lcia import Ecospold1LCIAImporter

File ~\anaconda3\envs\brightway_\lib\site-packages\bw2io\importers\ecoinvent_lcia.py:19
15 from ..strategies.lcia import fix_ecoinvent_38_lcia_implementation
16 from .base_lcia import LCIAImporter
---> 19 class EcoinventLCIAImporter(LCIAImporter):
20 """
21 A class for importing ecoinvent-compatible LCIA methods
22
23 """
25 def init(self, biosphere_database: str | None = None):

File ~\anaconda3\envs\brightway_\lib\site-packages\bw2io\importers\ecoinvent_lcia.py:25, in EcoinventLCIAImporter()
19 class EcoinventLCIAImporter(LCIAImporter):
20 """
21 A class for importing ecoinvent-compatible LCIA methods
22
23 """
---> 25 def init(self, biosphere_database: str | None = None):
26 """Initialize an instance of EcoinventLCIAImporter.
27
28 Defines strategies in __init__ because config.biosphere is dynamic.
29 """
30 self.strategies = [
31 normalize_units,
32 set_biosphere_type,
(...)
38 ),
39 ]

TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

I'm not sure how to address this issue. I've already tried reinstalling Brightway, but it hasn't resolved the problem.

Could someone please provide guidance on how to resolve this error?

Thank you in advance for your assistance.

@LouiseBru LouiseBru added bug status:Needs Triage Applied to issues that need triage labels Apr 10, 2024
@RRosio
Copy link
Collaborator

RRosio commented Apr 16, 2024

Hi @LouiseBru, have you opened an issue in the Brightway2 repository, https://github.com/brightway-lca/brightway2, for the issue you are encountering? This seems like an issue that may not be in the Jupyter Notebook codebase. I will close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug status:Needs Triage Applied to issues that need triage
Projects
None yet
Development

No branches or pull requests

2 participants