成功解决RuntimeError: Decompression ‘SNAPPY‘ not available.  Options: [‘GZIP‘, ‘UNCOMPRESSED‘]

成功解决RuntimeError: Decompression 'SNAPPY' not available.  Options: ['GZIP', 'UNCOMPRESSED']

 

 

 

目录

解决问题

解决思路

解决方法


 

 

 

 

解决问题

D:\ProgramData\Anaconda3\python.exe E:/Python_Program/0925KBQNodel/抗辩期模型_v01_1105.py
Traceback (most recent call last):
  File "E:/Python_Program/0925KBQNodel/抗辩期模型_v01_1105.py", line 31, in <module>
    df = pd.read_parquet('./data_contest_20201022_sample.parquet')
  File "D:\ProgramData\Anaconda3\lib\site-packages\pandas\io\parquet.py", line 317, in read_parquet
    return impl.read(path, columns=columns, **kwargs)
  File "D:\ProgramData\Anaconda3\lib\site-packages\pandas\io\parquet.py", line 212, in read
    return parquet_file.to_pandas(columns=columns, **kwargs)
  File "D:\ProgramData\Anaconda3\lib\site-packages\fastparquet\api.py", line 399, in to_pandas
    index=index, assign=parts)
  File "D:\ProgramData\Anaconda3\lib\site-packages\fastparquet\api.py", line 228, in read_row_group
    scheme=self.file_scheme)
  File "D:\ProgramData\Anaconda3\lib\site-packages\fastparquet\core.py", line 355, in read_row_group
    cats, selfmade, assign=assign)
  File "D:\ProgramData\Anaconda3\lib\site-packages\fastparquet\core.py", line 332, in read_row_group_arrays
    catdef=out.get(name+'-catdef', None))
  File "D:\ProgramData\Anaconda3\lib\site-packages\fastparquet\core.py", line 199, in read_col
    dic = read_dictionary_page(infile, schema_helper, ph, cmd)
  File "D:\ProgramData\Anaconda3\lib\site-packages\fastparquet\core.py", line 157, in read_dictionary_page
    raw_bytes = _read_page(file_obj, page_header, column_metadata)
  File "D:\ProgramData\Anaconda3\lib\site-packages\fastparquet\core.py", line 25, in _read_page
    column_metadata.codec,
  File "D:\ProgramData\Anaconda3\lib\site-packages\fastparquet\compression.py", line 128, in decompress_data
    (algorithm.upper(), sorted(decompressions)))
RuntimeError: Decompression 'SNAPPY' not available.  Options: ['GZIP', 'UNCOMPRESSED']

 

 

解决思路

运行时错误:解压“SNAPPY”不可用。选择:(GZIP,“压缩”)

 

 

 

 

解决方法

pip install python-snappy
pip install pyarrow
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple python-snappy
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyarrow

 

哈哈,大功告成!

 

 

 

 

 


 

©️2020 CSDN 皮肤主题: 代码科技 设计师:Amelia_0503 返回首页
实付 29.90元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值