1

There was a previous issue here but it didn't help me with my problem:

When I try to change an exchanged amount with .amount = myamount I always get a "can't set attribute error".

Here is what i did:

## search for activity
msw = [get_activity(key) for key, ds in eco.items() if 
           'treatment of municipal solid waste, incineration' in ds['name'] and 
           ds['location'] == ('BE') and ds['unit'] == 'kilogram']

and

##make a copy
msw_be = msw.copy()

##get exchange
Carbon_dioxide_non_fossil = [exc for exc in mswi_be.biosphere() if 'Carbon dioxide, non-fossil' in exc['name']][0]

and then

##change amount
Carbon_dioxide_non_fossil.amount = 0.75152

here is where i get the error. Thank you for helping me.

papa pupu
  • 33
  • 1
  • 3

1 Answers1

1

You activities act like dictionaries, and don't support attribute access. Try this instead:

Carbon_dioxide_non_fossil['amount'] = 0.75152
Carbon_dioxide_non_fossil.save()
Chris Mutel
  • 2,549
  • 1
  • 14
  • 9