Brightway2:导入 ecoinvent 3.6 时出现问题(ecospold 文件)

Brightway2: Problems importing ecoinvent 3.6 (ecospold files)

我想在我的 brightway2 项目中导入 ecoinvent 3.6 数据库。 我已经从 Ecoinvent 下载了所需的 ecospold 数据文件,但是我收到以下错误:

fpei36 = r"C:~\ecoinvent_36_cut-off_lci_ecoSpold02.7z" # name of path 
ei36 = bw.SingleOutputEcospold2Importer(fpei36, 'ecoinvent 3.6 cutoff')

Traceback (most recent call last):

File "", line 1, in ei36 = bw.SingleOutputEcospold2Importer(fpei36, 'ecoinvent 3.6 cutoff')

File "~\Anaconda\lib\site-packages\bw2io\importers\ecospold2.py", line 67, in init self.data = extractor.extract(dirpath, db_name, use_mp=use_mp)

File "~\Anaconda\lib\site-packages\bw2io\extractors\ecospold2.py", line 93, in extract data = [p.get() for p in results]

File "~\Anaconda\lib\site-packages\bw2io\extractors\ecospold2.py", line 93, in data = [p.get() for p in results]

File "~\Anaconda\lib\multiprocessing\pool.py", line 657, in get raise self._value

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbc in position 2: invalid start byte

我不知道 1) 出了什么问题以及 b) 我该如何解决问题。

感谢您的帮助!

您正在传递 zip (.7z) 文件的路径。 dirpath 参数应该是 zip 文件中包含 files 的目录路径。

要开始,只需先解压缩文件,然后将代码更改为 fpei36 = r"C:~\path_to_dir_with_thousands_of_ecospold_files"

您可以在 Python 中解压缩文件,编码前请参阅 here for example. You can also simply unzip it using a tool such as this