I am performing the LCA project using python and I created different excel input files. However, I have a problem with one database and can not create a database in jupyter notebook. Because of this problem, further steps are blocked. Could someone please tell me what is wrong? Why is this not working while others work smoothly?
Input : imp.write_database()
Output :
UntypedExchange Traceback (most recent call last)
Input In [11], in <cell line: 1>()
----> 1 imp.write_database()
File ~\anaconda3\envs\Manganese\lib\site-packages\bw2io\importers\excel.py:277, in ExcelImporter.write_database(self, kwargs)
275 """Same as base write_database method, but activate_parameters is True by default."""
276 kwargs["activate_parameters"] = kwargs.get("activate_parameters", True)
--> 277 super(ExcelImporter, self).write_database(kwargs)
File ~\anaconda3\envs\Manganese\lib\site-packages\bw2data\project.py:358, in writable_project(wrapped, instance, args, kwargs)
356 if projects.read_only:
357 raise ReadOnlyProject(READ_ONLY_PROJECT)
* --> 358 return wrapped(args, kwargs)
File ~\anaconda3\envs\Manganese\lib\site-packages\bw2data\backends\peewee\database.py:260, in SQLiteBackend.write(self, data, process)
258 if data:
259 try:
--> 260 self._efficient_write_many_data(data)
261 except:
262 # Purge all data from database, then reraise
263 self.delete(warn=False)
File ~\anaconda3\envs\Manganese\lib\site-packages\bw2data\backends\peewee\database.py:204, in SQLiteBackend._efficient_write_many_data(self, data, indices)
197 self.pbar = pyprind.ProgBar(
198 len(data),
199 title="Writing activities to SQLite3 database:",
200 monitor=True
201 )
203 for index, (key, ds) in enumerate(data.items()):
--> 204 exchanges, activities = self._efficient_write_dataset(
205 index, key, ds, exchanges, activities
206 )
208 if not getattr(config, "is_test", None):
209 print(self.pbar)
File ~\anaconda3\envs\Manganese\lib\site-packages\bw2data\backends\peewee\database.py:158, in SQLiteBackend._efficient_write_dataset(self, index, key, ds, exchanges, activities)
156 raise InvalidExchange
157 if 'type' not in exchange:
--> 158 raise UntypedExchange
159 exchange['output'] = key
160 exchanges.append(dict_as_exchangedataset(exchange))
I am performing the LCA project using python and I created different excel input files. However, I have a problem with one database and can not create a database in jupyter notebook. Because of this problem, further steps are blocked. Could someone please tell me what is wrong? Why is this not working while others work smoothly? Input : imp.write_database() Output :
Writing activities to SQLite3 database: 0% [### ] 100% | ETA: 00:00:00
UntypedExchange Traceback (most recent call last) Input In [11], in <cell line: 1>() ----> 1 imp.write_database()
File ~\anaconda3\envs\Manganese\lib\site-packages\bw2io\importers\excel.py:277, in ExcelImporter.write_database(self, kwargs) 275 """Same as base
write_database
method, butactivate_parameters
is True by default.""" 276 kwargs["activate_parameters"] = kwargs.get("activate_parameters", True) --> 277 super(ExcelImporter, self).write_database(kwargs)File ~\anaconda3\envs\Manganese\lib\site-packages\bw2io\importers\base_lci.py:269, in LCIImporter.write_database(self, data, delete_existing, backend, activate_parameters, kwargs) 266 self.write_database_parameters(activate_parameters, delete_existing) 268 existing.update(data) --> 269 db.write(existing)** 271 if activate_parameters: 272 self._write_activity_parameters(activity_parameters)
File ~\anaconda3\envs\Manganese\lib\site-packages\bw2data\project.py:358, in writable_project(wrapped, instance, args, kwargs) 356 if projects.read_only: 357 raise ReadOnlyProject(READ_ONLY_PROJECT) * --> 358 return wrapped(args, kwargs)
File ~\anaconda3\envs\Manganese\lib\site-packages\bw2data\backends\peewee\database.py:260, in SQLiteBackend.write(self, data, process) 258 if data: 259 try: --> 260 self._efficient_write_many_data(data) 261 except: 262 # Purge all data from database, then reraise 263 self.delete(warn=False)
File ~\anaconda3\envs\Manganese\lib\site-packages\bw2data\backends\peewee\database.py:204, in SQLiteBackend._efficient_write_many_data(self, data, indices) 197 self.pbar = pyprind.ProgBar( 198 len(data), 199 title="Writing activities to SQLite3 database:", 200 monitor=True 201 ) 203 for index, (key, ds) in enumerate(data.items()): --> 204 exchanges, activities = self._efficient_write_dataset( 205 index, key, ds, exchanges, activities 206 ) 208 if not getattr(config, "is_test", None): 209 print(self.pbar)
File ~\anaconda3\envs\Manganese\lib\site-packages\bw2data\backends\peewee\database.py:158, in SQLiteBackend._efficient_write_dataset(self, index, key, ds, exchanges, activities) 156 raise InvalidExchange 157 if 'type' not in exchange: --> 158 raise UntypedExchange 159 exchange['output'] = key 160 exchanges.append(dict_as_exchangedataset(exchange))
UntypedExchange: