brightway-lca / brightway2-calc

The calculation engine for the Brightway2 life cycle assessment framework.
BSD 3-Clause "New" or "Revised" License
12 stars 15 forks source link

'NpzFile' object #54

Closed mheiker closed 2 years ago

mheiker commented 2 years ago

Running lci() is causing this error massage:

do_lca()
Traceback (most recent call last):

  File "C:\Users\maheiker\AppData\Local\Temp\ipykernel_5780\3195157704.py", line 1, in <module>
    do_lca()

  File "C:\Users\maheiker\AppData\Local\Temp\ipykernel_5780\861550312.py", line 6, in do_lca
    lca.lci()

  File "C:\Users\maheiker\anaconda3\lib\site-packages\bw2calc\lca.py", line 338, in lci
    self.load_lci_data(builder=builder)

  File "C:\Users\maheiker\anaconda3\lib\site-packages\bw2calc\lca.py", line 217, in load_lci_data
    builder.build(self.database_filepath)

  File "C:\Users\maheiker\anaconda3\lib\site-packages\bw2calc\matrices.py", line 143, in build
    array = load_arrays(paths)

  File "C:\Users\maheiker\anaconda3\lib\site-packages\bw2calc\utils.py", line 40, in load_arrays
    if all(arr.shape[0] == 0 for arr in arrays):

  File "C:\Users\maheiker\anaconda3\lib\site-packages\bw2calc\utils.py", line 40, in <genexpr>
    if all(arr.shape[0] == 0 for arr in arrays):

AttributeError: 'NpzFile' object has no attribute 'shape'
cmutel commented 2 years ago

Hi @mheiker, thanks for filing this. Can you please run the following and give the outputs?

import bw2data, bw2calc
bw2data.__version__, bw2calc.__version__
mheiker commented 2 years ago

Hi @cmutel, yes, of course, but I get another error message:

((4, 0, 'DEV15'), (1, 8, 1))Error in callback <bound method AutoreloadMagics.post_execute_hook of <autoreload.AutoreloadMagics object at 0x000001CB794F9940>> (for post_execute):
Traceback (most recent call last):

  File "C:\Users\maheiker\anaconda3\lib\site-packages\IPython\extensions\autoreload.py", line 538, in post_execute_hook
    _, pymtime = self._reloader.filename_and_mtime(sys.modules[modname])

  File "C:\Users\maheiker\anaconda3\lib\site-packages\IPython\extensions\autoreload.py", line 184, in filename_and_mtime
    if not hasattr(module, '__file__') or module.__file__ is None:

  File "C:\Users\maheiker\anaconda3\lib\site-packages\eight\utils.py", line 41, in __getattr__
    self._module = __import__(self._name)

ModuleNotFoundError: No module named '_dummy_thread'
cmutel commented 2 years ago

Your bw2data is using a beta version (4.0.dev15), which isn't compatible with your bw2calc. The easiest way to solve this is to create a new environment and follow the installation instructions, which always state you should install only brightway2. This metapackage will make sure you have the correct bw2data, bw2calc, etc.