我在 Brightway 工作了一年。但是,我最近尝试安装在一台新 PC 上(使用 Windows 10)。首先,我在讨论后解决了 bw2calc 的问题: https ://github.com/brightway-lca/brightway2-calc/issues/36 。然后,在 jupyter notebook 中,我开始设置项目:
project.set_current (new)
我有这个错误信息:
---------------------------------------------------------------------------
IntegrityError Traceback (most recent call last)
~\Miniconda3\envs\BW2\lib\site-packages\peewee.py in execute_sql(self, sql, params, commit)
3159 try:
-> 3160 cursor.execute(sql, params or ())
3161 except Exception:
IntegrityError: NOT NULL constraint failed: projectdataset.full_hash
During handling of the above exception, another exception occurred:
IntegrityError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_16580/2692245280.py in <module>
----> 1 projects.set_current("new")
~\Miniconda3\envs\BW2\lib\site-packages\bw2data\project.py in set_current(self, name, writable, update)
141 # for new metadata stores
142 self.read_only = False
--> 143 self.create_project(name)
144 self._reset_meta()
145 self._reset_sqlite3_databases()
~\Miniconda3\envs\BW2\lib\site-packages\bw2data\project.py in create_project(self, name, **kwargs)
210 if not ProjectDataset.select().where(
211 ProjectDataset.name == name).count():
--> 212 ProjectDataset.create(
213 data=kwargs,
214 name=name
~\Miniconda3\envs\BW2\lib\site-packages\peewee.py in create(cls, **query)
6391 def create(cls, **query):
6392 inst = cls(**query)
-> 6393 inst.save(force_insert=True)
6394 return inst
6395
~\Miniconda3\envs\BW2\lib\site-packages\peewee.py in save(self, force_insert, only)
6601 rows = self.update(**field_dict).where(self._pk_expr()).execute()
6602 elif pk_field is not None:
-> 6603 pk = self.insert(**field_dict).execute()
6604 if pk is not None and (self._meta.auto_increment or
6605 pk_value is None):
~\Miniconda3\envs\BW2\lib\site-packages\peewee.py in inner(self, database, *args, **kwargs)
1909 raise InterfaceError('Query must be bound to a database in order '
1910 'to call "%s".' % method.__name__)
-> 1911 return method(self, database, *args, **kwargs)
1912 return inner
1913
~\Miniconda3\envs\BW2\lib\site-packages\peewee.py in execute(self, database)
1980 @database_required
1981 def execute(self, database):
-> 1982 return self._execute(database)
1983
1984 def _execute(self, database):
~\Miniconda3\envs\BW2\lib\site-packages\peewee.py in _execute(self, database)
2759 self._returning = (self.table._primary_key,)
2760 try:
-> 2761 return super(Insert, self)._execute(database)
2762 except self.DefaultValuesException:
2763 pass
~\Miniconda3\envs\BW2\lib\site-packages\peewee.py in _execute(self, database)
2477 cursor = self.execute_returning(database)
2478 else:
-> 2479 cursor = database.execute(self)
2480 return self.handle_result(database, cursor)
2481
~\Miniconda3\envs\BW2\lib\site-packages\peewee.py in execute(self, query, commit, **context_options)
3171 ctx = self.get_sql_context(**context_options)
3172 sql, params = ctx.sql(query).query()
-> 3173 return self.execute_sql(sql, params, commit=commit)
3174
3175 def get_context_options(self):
~\Miniconda3\envs\BW2\lib\site-packages\peewee.py in execute_sql(self, sql, params, commit)
3165 else:
3166 if commit and not self.in_transaction():
-> 3167 self.commit()
3168 return cursor
3169
~\Miniconda3\envs\BW2\lib\site-packages\peewee.py in __exit__(self, exc_type, exc_value, traceback)
2931 new_type = self.exceptions[exc_type.__name__]
2932 exc_args = exc_value.args
-> 2933 reraise(new_type, new_type(exc_value, *exc_args), traceback)
2934
2935
~\Miniconda3\envs\BW2\lib\site-packages\peewee.py 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
193
~\Miniconda3\envs\BW2\lib\site-packages\peewee.py in execute_sql(self, sql, params, commit)
3158 cursor = self.cursor(commit)
3159 try:
-> 3160 cursor.execute(sql, params or ())
3161 except Exception:
3162 if self.autorollback and not self.in_transaction():
IntegrityError: NOT NULL constraint failed: projectdataset.full_hash
拜托,我需要帮助!先感谢您...