Re: AttributeError: module 'snappy' has no attribute 'compress'

519 views
Skip to first unread message

Elimboto Yohana

unread,
Jul 29, 2021, 7:05:19 AM7/29/21
to sage-cell, Andrey Novoseltsev
Hi Andrey and the Team,

Probably the long-standing problem "AttributeError: module 'snappy' has no attribute 'compress'" can now be solved. A GitHub reply by "martindurant"  -- "Note that this will no longer happen, fastparquet recent releases always support snappy via cramjam" suggests that the installation of cramjam can solve the problem:

pip install cramjam (https://pypi.org/project/cramjam/)

I will also appreciate if you can install xlrd (pip install xlrd -- https://pypi.org/project/xlrd/) which is used by autoviz as "from autoviz.AutoViz_Class import AutoViz_Class" raises the error "ModuleNotFoundError: No module named 'xlrd'".


Kind regards,

Elimboto





On Sun, Jul 25, 2021 at 2:59 PM Elimboto Yohana <e...@tssfl.com> wrote:
Hi Andrey,

Almost all cosmology/astrophysics/astronomy codes which is my primary interest are not working due to the error: AttributeError: module 'snappy' has no attribute 'compress'. Similarly, most of the Plotly modules will raise the same error.

Anything to do with Astropy, HDF5/h5py, astronomical data compression, Ploly modules such as plotly.express, and more will complain about Snappy and will never work.

Snappy module is a big issue now, can't something be done on your side?

Kind regards,

Elimboto


Andrey Novoseltsev

unread,
Aug 2, 2021, 11:33:38 PM8/2/21
to sage-cell
Installed!

Also, for the record, I never got that email from July 25 ;-)

Best,
Andrey

Elimboto Yohana

unread,
Aug 3, 2021, 3:44:52 AM8/3/21
to Andrey Novoseltsev, sage-cell
Thank you Andrey. This error is still there "AttributeError: module 'snappy' has no attribute 'compress'. You can confirm that by trying to import either of the modules below:

from cramjam import snappy
#from astropy.io import fits
#import plotly.express
#from astropy.visualization import astropy_mpl_style
#from astropy.coordinates import SkyCoord, EarthLocation
#from astropy import coordinates as coord
#from astropy.coordinates.tests.utils import randomly_sample_sphere

I will explore the problem locally and let you know of the possible solution.

Kind regards,

Elimboto




--
You received this message because you are subscribed to the Google Groups "sage-cell" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-cell+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-cell/0275ddbf-fe6b-4741-9b21-97770189383bn%40googlegroups.com.

Elimboto Yohana

unread,
Aug 4, 2021, 3:19:29 PM8/4/21
to Andrey Novoseltsev, sage-cell
Hi Andrey,

There are at least three Python packages with the name snappy:

This can be install as pip install snappy, and the command installs the following packages: FXrays-1.3.5 cypari-2.4.1 decorator-4.4.2 future-0.18.2 knot-floer-homology-1.0.2 plink-2.4 pypng-0.0.20 snappy-3.0.1 snappy-manifolds-1.1.2 spherogram-2.0.

2. snappy-manifolds 1.1.2 (https://pypi.org/project/snappy-manifolds/#history) -- pip install snappy-manifolds: This one is part of the snappy package above.

3. python-snappy 0.6.0 (https://pypi.org/project/python-snappy/) -- pip install python-snappy: This is the one that other packages which use it complain it has no attribute compress.

I installed all these packages one by one and tested the codes with Python 3.9.6 (and also with Ipython 7.16.1) under Ubuntu-Linux 18.04 and did not notice any conflicts or an error in question.

Maybe later upgrade from python 3.9.2 to a higher version or uninstalling and reinstalling the snappy and python-snappy packages can solve the problem.

Kind regards,

Elimboto
Reply all
Reply to author
Forward
0 new messages