I have recently installed SNAP in my windows 10. During the installation, I configured python.exe. It is, however, not configured properly.I have the error log. Isnappyutil.log (796 Bytes)
I have thoroughly gone through another similar post but could not find a solution.
I am using python 2.7 with spyder.
Do you have the Windows 32-bit SNAP? From the log it looks like you have a 32-bit python 2.7:
INFO: Extracting 'lib/jpy-0.9.0-cp27-cp27m-win32.whl' from 'D:\snap\snap\modules\org-esa-snap-snap-python.jar'
INFO: Unzipping 'C:\Users\Administrator\.snap\snap-python\snappy\lib\jpy-0.9.0-cp27-cp27m-win32.whl'
The instructions should probably mention that you need to use a 64-bit Python with a 64-bit SNAP.
ArcGIS users often encounter this problem. If you do need keep your 32-bit Python it can be a bit tricky to ensure that different applications use the matching Python version. If you do need to install a 64-bit Python for snappy I recommend the most recent supported Python (3.6). You will end up with two
python.exe programs. I like to install them in
If you append
<snappy-dir> to the
sys.path variable in your Python code before importing
snappy, along the lines of the template using
USERPROFILE to locate the
snappy module you can use
.cmd files to provide the path to the Python version you want to use with snappy. For each Python script that uses snappy you can either use a one-line
or make a file
C:\Python36\python <path_to_script>/<script_name.py> %*
pause is needed if you run the script by clicking on it so the terminal window doesn’t close before you get a chance to see any output).
I am not sure what it means to have two versions of python. I used arcGIS in my system about two years ago. Since I don’t use arcGIS anymore I can delete the other version of python. Can you tell me how to do it? I am not able to find other version of pyhton except the one that I just reinstalled (python 3.7, 64-bit); my snap version is also 64-bit.
Python 3.7 is too new to work with snappy. Your log indicates that
snappy-conf found a 32-bit python 2.7, so I’m guessing that the failure was because you installed 64-bit SNAP. Windows often has multiple python programs. GIS packages other than ArcGIS (QGIS) install Python. Window 10 search isn’t good at finding “python.exe”, so it can be hard to detect unwanted versions. You can try running
pythonX --version in a terminal to see what
snappy-conf would find if you don’t specify something like `C:\PythonNN\python.exe. Here I get:
C:\>echo (none) & python --version & echo 2 & python2 --version & echo 3 & python3 --version
(In Windows 10 if you just enter
python in a terminal the App Store offers version 3.7).
Your best bet is to get the Python Foundation’s Python 3.6.8 someplace like
C:\Python36 and always use
snappy-conf and for snappy scripts.
Thank you gnwiii.
I removed pyhton2.7 and pyhton 3.7 and installed the one you suggested.