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

Keyerror while importing Ecoinvent db #333

Closed
lefterav opened this issue Nov 17, 2019 · 6 comments
Closed

Keyerror while importing Ecoinvent db #333

lefterav opened this issue Nov 17, 2019 · 6 comments

Comments

@lefterav
Copy link

Importing the Ecoinvent DB via a login (download) doesn't seem to finish, and it gives the following error:

Traceback (most recent call last):
  File "/home/lefterav/tools/miniconda/envs/ab/lib/python3.6/site-packages/activity_browser/app/ui/wizards/db_import_wizard.py", line 668, in initializePage
    self.update_system_model_combobox(self.version_combobox.currentText())
  File "/home/lefterav/tools/miniconda/envs/ab/lib/python3.6/site-packages/activity_browser/app/ui/wizards/db_import_wizard.py", line 679, in update_system_model_combobox
    self.system_model_combobox.addItems(self.system_models[version])
KeyError: ''

Traceback (most recent call last):
  File "/home/lefterav/tools/miniconda/envs/ab/lib/python3.6/site-packages/activity_browser/app/ui/wizards/db_import_wizard.py", line 459, in run
    self.run_ecoinvent()
  File "/home/lefterav/tools/miniconda/envs/ab/lib/python3.6/site-packages/activity_browser/app/ui/wizards/db_import_wizard.py", line 470, in run_ecoinvent
    self.run_download()
  File "/home/lefterav/tools/miniconda/envs/ab/lib/python3.6/site-packages/activity_browser/app/ui/wizards/db_import_wizard.py", line 506, in run_download
    self.downloader.download()
  File "/home/lefterav/tools/miniconda/envs/ab/lib/python3.6/site-packages/eidl/core.py", line 139, in download
    file_content = self.session.get(url + self.db_dict[db_key], timeout=60).content
KeyError: ('', '')

@dgdekoning
Copy link
Contributor

Interesting, so during creation of the dropdown menu it looks like some incorrect information is being passed around. I wonder where the problem is coming from now.

@dgdekoning
Copy link
Contributor

dgdekoning commented Nov 17, 2019

Can you tell me if you're using the stable or the development build, and which version?

(edit:) and also, which version/system of the ecoinvent caused the problem?

@lefterav
Copy link
Author

I just realized that I had logged in as a guest user, so download should not be allowed by that license. If this is the reason, the GUI doesn't display any relevant error, and the command-line error is not any informative either.
I am using the stable version of AB. No version/system was displayed in the dropdown menus, so I proceeded without them.

@dgdekoning
Copy link
Contributor

That is something we'd not considered, I'll see if there is a good way of showing an error when using a non-authorized account.
Thanks for responding!

dgdekoning added a commit that referenced this issue Dec 12, 2019
dgdekoning added a commit that referenced this issue Dec 13, 2019
* Implement page enums for import wizard, pages now have explicit nextId page

* Ensure no db import can take place before biosphere (biosphere3) exists

* Speedup 7zip extract by not printing 'Extracted ...' lines.

* Force cleanup of DatabaseImportWizard on creation and project change

* Subclass BW2Package to allow check for required dependencies

* Move tempdir creation and handling together, feed correct paths to methods

* Rename 'import failed' signal for clarity

* Possible fix for #333
@dgdekoning
Copy link
Contributor

@lefterav, the newest development build of the activity browser contains a possible fix for this issue, can you see if it resolves the issue (or at least, gives a usable error message)?

@dgdekoning
Copy link
Contributor

Closing this because it seems to be resolved. Please don't hesitate to reopen if the issue still occurs @lefterav.

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