模块'snappy'没有属性'decompress' [英] module 'snappy' has no attribute 'decompress'

查看:216
本文介绍了模块'snappy'没有属性'decompress'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用kafka-python.它要求安装Snappy.所以我安装了

I'm tring to use kafka-python. It request to install Snappy. So I install it by

  1. pip install snappy
  2. 点安装python_snappy-0.5.2-cp36-cp36m-win_amd64.whl 两种方法都可以使Snappy成功安装.
  1. pip install snappy
  2. pip install python_snappy-0.5.2-cp36-cp36m-win_amd64.whl In both ways Snappy install successfully.

但是在两次尝试在我导入"kafka"的地方运行python代码时,我都遇到了错误.

But in both time when i'm trying to run python code where i import 'kafka', i got an error.

错误:

AttributeError:模块'snappy'没有属性'decompress'

AttributeError: module 'snappy' has no attribute 'decompress'

我跑步时

import snappy
help(snappy)

结果是:

Help on package snappy:

NAME
    snappy

PACKAGE CONTENTS
    __main__
    _snappy
    hadoop_snappy
    snappy
    snappy_cffi
    snappy_cffi_builder
    snappy_formats

FILE
    (built-in)

我在Windows环境(Win 10)中使用conda.

I'm using conda in Windows environment (Win 10).

我该如何克服这个问题?

How can i overcome this problem?

推荐答案

我相信您已经安装了 SnapPy 几何软件包.您应该安装pip install python-snappy而不是pip install snappy.您要查找的snappy软件包在这里 Python快照

I believe you've installed SnapPy a package for geometry. You should install pip install python-snappy instead of pip install snappy. The snappy package you're looking for is here Python-snappy

这篇关于模块'snappy'没有属性'decompress'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆