Search code examples
pythonlinuxpython-3.xversionsnap-python

ESA's snap-python (snappy) isn't working with python 3.5 and later


As in ESA's snappy official installation guide, supported python versions are only: 2.7, 3,3 and 3.4

I need to install ESA's snappy library for python 3.6. Is there any way i could do so?


Solution

  • I found out that I could use ESA's snappy with python 3.6 but I first had to install jpy from github.

    git clone https://github.com/bcdev/jpy.git
    cd jpy/
    

    Activate virtual environment if someone uses one

    source ~/venv/venvsname/bin/activate
    

    Build the wheel

    python3.6 setup.py bdist_wheel
    

    Copy the created .whl file into snappy directory

    cp dist/*.whl "~/.snap/snap-python/snappy"
    

    Run setup to add jpy to your packages

    python setup.py install
    

    Then, in order to load snappy library we could either append path

    import sys
    sys.path.append('~/.snap/snap-python/')
    import snappy
    

    Or copy snappy directory into environment site-packages directory

    cp ~/.snap/snap-python/snappy ~/vens/venvsname/lib/python3.6/site-packages
    import snappy