簡體   English   中英

EOFError:在解壓縮bz2文件中檢測到邏輯流結束之前壓縮文件已結束

[英]EOFError: compressed file ended before the logical end-of-stream was detected in decompressing bz2 file

當我嘗試解壓縮Wikipedia轉儲以使用其.xml文件時,出現此錯誤。 我該如何解決?

filepath='/Data/nlp/ESA/Wiki-ESA-master'
file_name='enwiki-latest-pages-articles.xml.bz2'
zipfile = bz2.BZ2File(file_name) # open the file
DEFAULT_FILENAME = zipfile.read() # get the decompressed data

錯誤:

EOFError: compressed file ended before the logical end-of-stream was detected

如錯誤所述,下載過程很可能過早終止,並且文件已被截斷。 嘗試再次下載。

另一個原因可能是磁盤上的數據已損壞。 再次下載可能也對此有所幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM