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

Database setup fails with KeyError: 'name' #224

Open
SamiraHuber opened this issue Oct 13, 2023 · 3 comments
Open

Database setup fails with KeyError: 'name' #224

SamiraHuber opened this issue Oct 13, 2023 · 3 comments

Comments

@SamiraHuber
Copy link

I'm currently facing an issue with the brightway2 package, when running the command agb_importer.write_database() to set up the database. The error I encounter is:

Traceback (most recent call last):
  File "/home/tu/git-repo/LCAI-API/setup/main.py", line 253, in <module>
    main()
  File "/home/tu/git-repo/LCAI-API/setup/main.py", line 160, in main
    agb_importer.write_database()
  File "/home/tu/.local/lib/python3.10/site-packages/bw2io/importers/simapro_csv.py", line 103, in write_database
    db = super(SimaProCSVImporter, self).write_database(data, name, *args, **kwargs)
  File "/home/tu/.local/lib/python3.10/site-packages/bw2io/importers/base_lci.py", line 242, in write_database
    duplicates.append(o["name"])
KeyError: 'name'

This setup involves using the CSV version of Agribalyse for data. The command works fine on my and my coworkers local machines (One windows user, on mac user) and has worked in Docker in the past. We haven't changed anything since than. However, now it throws an error in the Docker environment and on other servers. We've ensured that the Python version and package versions are identical across setups (see requirements.txt).

requirements.txt

What could be causing this discrepancy between environments, and how might I resolve it? We would really appreciate any kind of tipp or idea on how to make it run again.

@amadotalita
Copy link

Hi, I am having the same problem. Any solution so far?

@SamiraHuber
Copy link
Author

Hi, I am having the same problem. Any solution so far?

@amadotalita
So far I could only solve it by using following versions:

brightway2==2.4.2
bw2io==0.8.7

But I hope they fix it for the new versions soon!

@amadotalita
Copy link

Yes, let's wait then. thank you

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

2 participants