SingleOutputEcospold1Importer返回" NameError:name' filename'没有定义"

时间:2018-02-20 22:29:01

标签: import filenames brightway

我试图导入ecoinvent 3.4 cutoff数据库,所以我写道:

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:name' filename'没有定义。

它还表示问题出现在使用SingleOutputEcospold1Importer的行。

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

1 个答案:

答案 0 :(得分:0)

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

相关问题