Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

module 'snappy' has no attribute 'decompress'

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

  1. pip install snappy
  2. pip install python_snappy-0.5.2-cp36-cp36m-win_amd64.whl In both ways Snappy install successfully.

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

Error:

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

When I run,

import snappy
help(snappy)

Result is:

Help on package snappy:

NAME
    snappy

PACKAGE CONTENTS
    __main__
    _snappy
    hadoop_snappy
    snappy
    snappy_cffi
    snappy_cffi_builder
    snappy_formats

FILE
    (built-in)

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

How can i overcome this problem?

like image 356
GihanDB Avatar asked Jan 31 '18 06:01

GihanDB


1 Answers

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

like image 155
thuyein Avatar answered Oct 17 '22 00:10

thuyein