Error while importing snappy

Hello,

after successful installation of snappy on my PC, we have tried to install it on operational PC. Installation went quite easily. After launching import snappy first time, it worked perfectly. 30 minutes later I have tried to launch my python script but after calling import snappy I get the following error.

Traceback (most recent call last):
  File "bands_subset.py", line 6, in <module>
    import snappy
  File "/home/student/.snap/snap-python/snappy/snappy/__init__.py", line 23
    EXCLUDED_NB_CLUSTERS = {'platform', 'ide', 'bin', 'etc'}
                                      ^
SyntaxError: invalid syntax

I have really no idea hot to fix this.

This is really strange. I have no idea why the ‘,’ should be invalid.

The interesting part is, that first time I call import snappy, it does not work. When I call it second time, I do not get any error but also, snappy does not work properly.

Python 2.6.8 (unknown, Sep 27 2013, 16:07:59) 
[GCC 4.3.4 [gcc-4_3-branch revision 152973]] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> import time
>>> import snappy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "snappy/__init__.py", line 23
    EXCLUDED_NB_CLUSTERS = {'platform', 'ide', 'bin', 'etc'}
                                      ^
SyntaxError: invalid syntax
>>> import snappy
>>> import sys
>>> from snappy import ProductIO
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name ProductIO
>>>

Ah, now I see. You are using a pretty old Python. I don’t know if this is the reason but snappy is made for Python 2.7 - 3.4. If you update to at least 2.7, it might work.