0

我正在尝试导入 ecoinvent 3.4 截止数据库,所以我写道:

import brightway2 as bw

[...]

fpei34 = r'C:\Users\Me\Anaconda3\ecoinvent 3.4_cutoff_ecoSpold02\MasterData'

if 'ecoinvent 3.4 cutoff' in bw.databases:
    print("Database has already been imported")
else:
    ei34 = bw.SingleOutputEcospold1Importer(fpei34, 'ecoinvent 3.4 cutoff')
    ei34.apply_strategies()
    ei34.statistics()

我得到答案:

NameError:名称“文件名”未定义。

它还表明问题出现在使用的线路上SingleOutputEcospold1Importer

您知道我犯了什么错误以及如何安排代码吗?

4

1 回答 1

0

您的代码至少有两个问题:
- 您正在使用SingleOutputEcospold1Importer导入器。从 ecoinvent v3 开始,ecoinvent 数据库已移至 ecoSpold2 文件,因此您应该使用它SingleOutputEcospold2Importer
- 您的文件路径fpei34似乎是主数据,而不是数据集本身。您应该寻找一个datasets包含超过 14000 个 spold 文件的文件夹。

于 2018-02-21T11:47:42.650 回答