Git Product home page Git Product logo

Comments (8)

BenPortner avatar BenPortner commented on June 27, 2024 1

@TJTapajyoti that's strange! Try create_default_lcia_methods()?

from brightway2.

BenPortner avatar BenPortner commented on June 27, 2024 1

It seems you have a new version of xlrd installed, which does not support xlsx files anymore, see brightway-lca/brightway2-io#86. Can you try to downgrade xlrd and see if you can then run create_default_lcia_methods()?

from brightway2.

BenPortner avatar BenPortner commented on June 27, 2024

Hi @TJTapajyoti,

I believe it should be import, not install. Also please note that you need to run bw2setup() before any methods will show up. For a beginner guide see https://github.com/BenPortner/brightway_recipes.

Cheers.
Ben

from brightway2.

tjlca avatar tjlca commented on June 27, 2024

Hi @BenPortner I redid each and every step in your tutorial. I still got the same problem. On trying the function you mentioned, I am obtaining this error -

create_default_lcia_methods()
Traceback (most recent call last):

File "", line 1, in

    create_default_lcia_methods()

  File "/Users/tghosh/opt/anaconda3/envs/liason/lib/python3.8/site-packages/bw2io/__init__.py", line 91, in create_default_lcia_methods
    ei = EcoinventLCIAImporter()

  File "/Users/tghosh/opt/anaconda3/envs/liason/lib/python3.8/site-packages/bw2io/importers/ecoinvent_lcia.py", line 30, in __init__
    self.csv_data, self.cf_data, self.units, self.file = convert_lcia_methods_data()

  File "/Users/tghosh/opt/anaconda3/envs/liason/lib/python3.8/site-packages/bw2io/data/__init__.py", line 336, in convert_lcia_methods_data
    sheet = get_sheet(

  File "/Users/tghosh/opt/anaconda3/envs/liason/lib/python3.8/site-packages/bw2io/data/__init__.py", line 40, in get_sheet
    wb = xlrd.open_workbook(path)

  File "/Users/tghosh/opt/anaconda3/envs/liason/lib/python3.8/site-packages/xlrd/__init__.py", line 170, in open_workbook
    raise XLRDError(FILE_FORMAT_DESCRIPTIONS[file_format]+'; not supported')

XLRDError: Excel xlsx file; not supported

I have a question - are the default LCIA methods inbuilt in brightway2 or obtained from ecoinvent or some other database that I am missing? This seems like its trying to read a excel file that is not supported. Not sure if there is some excel file with all the LCIA methods.

from brightway2.

tjlca avatar tjlca commented on June 27, 2024

Just to confirm, I created a new project, ran bwsetup(), loaded ecoinvent(I have version 3.6), applied the strategies,statistics and write_database function. I made sure i am in the correct project. I checked the datasets and processes and they were fine. I defined functional units. Just then I am trying
bw.methods or for me just methods - as I imported everything from the module of brightway2 - I am getting -
Methods dictionary with 0 objects

I installed brightway 2.1 to check and I am getting the same error.
I am using python 3.8

Should I install brightway2 using pip or use conda install from cmutel?

from brightway2.

tjlca avatar tjlca commented on June 27, 2024

Hi @BenPortner so this interesting. I looked into the projects i had in my brightway2 and there were some old projects ( which remained even though I uninstalled and reinstalled brightway2) but when I am setting my current project as BW2intro or StepByStep, I have all the LCIA methods available.

projects.set_current("BW2intro")

bw.methods
Out[27]: 
Methods dictionary with 850 objects, including:
	('CML 2001 (obsolete)', 'acidification potential', 'average European')
	('CML 2001 (obsolete)', 'acidification potential', 'generic')
	('CML 2001 (obsolete)', 'climate change', 'GWP 100a')
	('CML 2001 (obsolete)', 'climate change', 'GWP 20a')
	('CML 2001 (obsolete)', 'climate change', 'GWP 500a')
	('CML 2001 (obsolete)', 'climate change', 'lower limit of net GWP')
	('CML 2001 (obsolete)', 'climate change', 'upper limit of net GWP')
	('CML 2001 (obsolete)', 'eutrophication potential', 'average European')
	('CML 2001 (obsolete)', 'eutrophication potential', 'generic')
	('CML 2001 (obsolete)', 'freshwater aquatic ecotoxicity', 'FAETP 100a')
Use `list(this object)` to get the complete list.

from brightway2.

tjlca avatar tjlca commented on June 27, 2024

@BenPortner Thanks so much for solving my issue. This works fine. create_default_lcia_methods()

had to downgrade xlrd

from brightway2.

BenPortner avatar BenPortner commented on June 27, 2024

@TJTapajyoti I'm glad it worked πŸ˜ƒ Please also run create_core_migrations() to complete the setup.

Happy brightway coding!

from brightway2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.