Closed tjlca closed 3 years ago
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
@TJTapajyoti that's strange! Try create_default_lcia_methods()
?
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 "
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.
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?
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.
It seems you have a new version of xlrd
installed, which does not support xlsx files anymore, see https://github.com/brightway-lca/brightway2-io/issues/86. Can you try to downgrade xlrd
and see if you can then run create_default_lcia_methods()
?
@BenPortner Thanks so much for solving my issue. This works fine. create_default_lcia_methods()
had to downgrade xlrd
@TJTapajyoti I'm glad it worked 😃 Please also run create_core_migrations()
to complete the setup.
Happy brightway coding!
This may be a minor issue due to improper setup -
Installed brightway2 using pip - python 3.8
gives 0. methods is empty. The LCIA methods are not showing up. Any help would be appreciated.