I am having the following error after I uploaded other databases and created LCA project for other inputs. However, this one is giving me the following error. If re-do the process, it gives another error as "Databa is locked".
Does anyone have any idea why this is happening? What is the solution?
After the analysis, I am mostly done with python and jupyter notebook. If someone could help me asap, it would mean a lot!
Thank for help in advance!
OperationalError Traceback (most recent call last)
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:3330, in Database.commit(self)
3329 with __exception_wrapper__:
-> 3330 return self._state.conn.commit()
OperationalError: database is locked
During handling of the above exception, another exception occurred:
OperationalError Traceback (most recent call last)
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:3184, in Database.execute_sql(self, sql, params, commit)
3183 if commit and not self.in_transaction():
-> 3184 self.commit()
3185 return cursor
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:3330, in Database.commit(self)
3329 with __exception_wrapper__:
-> 3330 return self._state.conn.commit()
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:191, in reraise(tp, value, tb)
190 if value.traceback is not tb:
--> 191 raise value.with_traceback(tb)
192 raise value
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:3330, in Database.commit(self)
3329 with __exception_wrapper__:
-> 3330 return self._state.conn.commit()
OperationalError: database is locked
During handling of the above exception, another exception occurred:
OperationalError Traceback (most recent call last)
File ~\anaconda3\envs\Manganese\lib\site-packages\bw2data\backends\peewee\database.py:260, in SQLiteBackend.write(self, data, process)
259 try:
--> 260 self._efficient_write_many_data(data)
261 except:
262 # Purge all data from database, then reraise
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:1918, in database_required..inner(self, database, *args, *kwargs)
1916 raise InterfaceError('Query must be bound to a database in order '
1917 'to call "%s".' % method.name)
-> 1918 return method(self, database, args, **kwargs)
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:3184, in Database.execute_sql(self, sql, params, commit)
3183 if commit and not self.in_transaction():
-> 3184 self.commit()
3185 return cursor
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:191, in reraise(tp, value, tb)
190 if value.traceback is not tb:
--> 191 raise value.with_traceback(tb)
192 raise value
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:3184, in Database.execute_sql(self, sql, params, commit)
3183 if commit and not self.in_transaction():
-> 3184 self.commit()
3185 return cursor
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:3330, in Database.commit(self)
3329 with __exception_wrapper__:
-> 3330 return self._state.conn.commit()
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:191, in reraise(tp, value, tb)
190 if value.traceback is not tb:
--> 191 raise value.with_traceback(tb)
192 raise value
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:3330, in Database.commit(self)
3329 with __exception_wrapper__:
-> 3330 return self._state.conn.commit()
OperationalError: database is locked
During handling of the above exception, another exception occurred:
During handling of the above exception, another exception occurred:
OperationalError Traceback (most recent call last)
Input In [28], 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\peewee.py:1918, in database_required..inner(self, database, *args, *kwargs)
1915 if not database:
1916 raise InterfaceError('Query must be bound to a database in order '
1917 'to call "%s".' % method.name)
-> 1918 return method(self, database, args, **kwargs)
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:191, in reraise(tp, value, tb)
189 def reraise(tp, value, tb=None):
190 if value.traceback is not tb:
--> 191 raise value.with_traceback(tb)
192 raise value
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:3177, in Database.execute_sql(self, sql, params, commit)
3175 cursor = self.cursor(commit)
3176 try:
-> 3177 cursor.execute(sql, params or ())
3178 except Exception:
3179 if self.autorollback and not self.in_transaction():
Hello everyone,
I am having the following error after I uploaded other databases and created LCA project for other inputs. However, this one is giving me the following error. If re-do the process, it gives another error as "Databa is locked".
Does anyone have any idea why this is happening? What is the solution?
After the analysis, I am mostly done with python and jupyter notebook. If someone could help me asap, it would mean a lot!
Thank for help in advance!
OperationalError Traceback (most recent call last) File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:3330, in Database.commit(self) 3329 with __exception_wrapper__: -> 3330 return self._state.conn.commit()
OperationalError: database is locked
During handling of the above exception, another exception occurred:
OperationalError Traceback (most recent call last) File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:3184, in Database.execute_sql(self, sql, params, commit) 3183 if commit and not self.in_transaction(): -> 3184 self.commit() 3185 return cursor
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:3330, in Database.commit(self) 3329 with __exception_wrapper__: -> 3330 return self._state.conn.commit()
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:2950, in ExceptionWrapper.exit(self, exc_type, exc_value, traceback) 2949 exc_args = exc_value.args -> 2950 reraise(new_type, new_type(exc_value, *exc_args), traceback)
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:191, in reraise(tp, value, tb) 190 if value.traceback is not tb: --> 191 raise value.with_traceback(tb) 192 raise value
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:3330, in Database.commit(self) 3329 with __exception_wrapper__: -> 3330 return self._state.conn.commit()
OperationalError: database is locked
During handling of the above exception, another exception occurred:
OperationalError Traceback (most recent call last) File ~\anaconda3\envs\Manganese\lib\site-packages\bw2data\backends\peewee\database.py:260, in SQLiteBackend.write(self, data, process) 259 try: --> 260 self._efficient_write_many_data(data) 261 except: 262 # Purge all data from database, then reraise
File ~\anaconda3\envs\Manganese\lib\site-packages\bw2data\backends\peewee\database.py:193, in SQLiteBackend._efficient_write_many_data(self, data, indices) 192 sqlite3_lci_db.db.begin() --> 193 self.delete(keep_params=True, warn=False) 194 exchanges, activities = [], []
File ~\anaconda3\envs\Manganese\lib\site-packages\bw2data\project.py:358, in writable_project(wrapped, instance, args, kwargs) 357 raise ReadOnlyProject(READ_ONLY_PROJECT) --> 358 return wrapped(*args, **kwargs)
File ~\anaconda3\envs\Manganese\lib\site-packages\bw2data\backends\peewee\database.py:332, in SQLiteBackend.delete(self, keep_params, warn) 330 vacuum_needed = len(self) > 500 --> 332 ActivityDataset.delete().where(ActivityDataset.database== self.name).execute() 333 ExchangeDataset.delete().where(ExchangeDataset.output_database== self.name).execute()
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:1918, in database_required..inner(self, database, *args, *kwargs)
1916 raise InterfaceError('Query must be bound to a database in order '
1917 'to call "%s".' % method.name)
-> 1918 return method(self, database, args, **kwargs)
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:1989, in BaseQuery.execute(self, database) 1987 @database_required 1988 def execute(self, database): -> 1989 return self._execute(database)
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:2496, in _WriteQuery._execute(self, database) 2495 else: -> 2496 cursor = database.execute(self) 2497 return self.handle_result(database, cursor)
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:3190, in Database.execute(self, query, commit, **context_options) 3189 sql, params = ctx.sql(query).query() -> 3190 return self.execute_sql(sql, params, commit=commit)
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:3184, in Database.execute_sql(self, sql, params, commit) 3183 if commit and not self.in_transaction(): -> 3184 self.commit() 3185 return cursor
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:2950, in ExceptionWrapper.exit(self, exc_type, exc_value, traceback) 2949 exc_args = exc_value.args -> 2950 reraise(new_type, new_type(exc_value, *exc_args), traceback)
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:191, in reraise(tp, value, tb) 190 if value.traceback is not tb: --> 191 raise value.with_traceback(tb) 192 raise value
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:3184, in Database.execute_sql(self, sql, params, commit) 3183 if commit and not self.in_transaction(): -> 3184 self.commit() 3185 return cursor
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:3330, in Database.commit(self) 3329 with __exception_wrapper__: -> 3330 return self._state.conn.commit()
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:2950, in ExceptionWrapper.exit(self, exc_type, exc_value, traceback) 2949 exc_args = exc_value.args -> 2950 reraise(new_type, new_type(exc_value, *exc_args), traceback)
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:191, in reraise(tp, value, tb) 190 if value.traceback is not tb: --> 191 raise value.with_traceback(tb) 192 raise value
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:3330, in Database.commit(self) 3329 with __exception_wrapper__: -> 3330 return self._state.conn.commit()
OperationalError: database is locked
During handling of the above exception, another exception occurred:
OperationalError Traceback (most recent call last) File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:3177, in Database.execute_sql(self, sql, params, commit) 3176 try: -> 3177 cursor.execute(sql, params or ()) 3178 except Exception:
OperationalError: database is locked
During handling of the above exception, another exception occurred:
OperationalError Traceback (most recent call last) Input In [28], 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:263, in SQLiteBackend.write(self, data, process) 260 self._efficient_write_many_data(data) 261 except: 262 # Purge all data from database, then reraise --> 263 self.delete(warn=False) 264 raise 266 self.make_searchable(reset=True)
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:332, in SQLiteBackend.delete(self, keep_params, warn) 328 warnings.warn(MESSAGE.format(self.name), UserWarning) 330 vacuum_needed = len(self) > 500 --> 332 ActivityDataset.delete().where(ActivityDataset.database== self.name).execute() 333 ExchangeDataset.delete().where(ExchangeDataset.output_database== self.name).execute() 334 IndexManager(self.filename).delete_database()
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:1918, in database_required..inner(self, database, *args, *kwargs)
1915 if not database:
1916 raise InterfaceError('Query must be bound to a database in order '
1917 'to call "%s".' % method.name)
-> 1918 return method(self, database, args, **kwargs)
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:1989, in BaseQuery.execute(self, database) 1987 @database_required 1988 def execute(self, database): -> 1989 return self._execute(database)
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:2496, in _WriteQuery._execute(self, database) 2494 cursor = self.execute_returning(database) 2495 else: -> 2496 cursor = database.execute(self) 2497 return self.handle_result(database, cursor)
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:3190, in Database.execute(self, query, commit, context_options) 3188 ctx = self.get_sql_context(context_options) 3189 sql, params = ctx.sql(query).query() -> 3190 return self.execute_sql(sql, params, commit=commit)
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:3184, in Database.execute_sql(self, sql, params, commit) 3182 else: 3183 if commit and not self.in_transaction(): -> 3184 self.commit() 3185 return cursor
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:2950, in ExceptionWrapper.exit(self, exc_type, exc_value, traceback) 2948 new_type = self.exceptions[exc_type.name] 2949 exc_args = exc_value.args -> 2950 reraise(new_type, new_type(exc_value, *exc_args), traceback)
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:191, in reraise(tp, value, tb) 189 def reraise(tp, value, tb=None): 190 if value.traceback is not tb: --> 191 raise value.with_traceback(tb) 192 raise value
File ~\anaconda3\envs\Manganese\lib\site-packages\peewee.py:3177, in Database.execute_sql(self, sql, params, commit) 3175 cursor = self.cursor(commit) 3176 try: -> 3177 cursor.execute(sql, params or ()) 3178 except Exception: 3179 if self.autorollback and not self.in_transaction():
OperationalError: database is locked