سئو
Hello friends
I’m new to the community
Thanks for this active community
I have used the instrcutions how to install and configure snappy but when i try to run the following commands
from snappy import ProductIO
import numpy as np
I get the followng error
Traceback (most recent call last):
File “<pyshell#6>”, line 1, in
from snappy import ProductIO
ImportError: No module named snappy
Probably the part in the section Configure Python did not work.
Maybe you have more than one Python installation and you have configured a different one as the one you use with your script.
I have same error, firstly I have installed miniconda 3.7, then I created py2 environment, during installing SNAP, I selected python2 as python executable,
In case you created a python2.7 environment (py2) a new directory should appear in anaconda\envs\py2 with a python.exe in it.
When you configure SNAP for the use with python as in the link above you have to make sure that you use this path, e.g. like this: snappy-conf C:\anaconda\envs\py2\python.exe
otherwise, the snappy libraries are installed elswhere
It seems that snappy has not been properly configure. You have mentioned that you use anaconda, so, you can create a virtual environment and install snappy in there. You can do the following:
create a virtual environment (conda crate -n snappy python=3.4). This command will create a virtual environment called snappy with python version 3.4. snappy does not work with a higher python version
configure python with SNAP.
cd snap/bin
/snappy-conf/full path of python interpreter (in my case: ./snappy-conf /home/miniconda3/envs/snappy/bin/python)
copy snappy folder into site-package of the virtual environment
cp -R snappy /home/miniconda3/envs/snappy/lib/python3.4/site-packages
snappy location: ~/.snap/snap-python/snappy
now snappy module is contained in the conda virtual environment.
I would suggest you to re-install SNAP and select python 3 for configuration not pytho2. Then follow the same steps of conda virtual environment creation
I firstly removed py2 env, and then I uninstalled SNAP, reinstalled SNAP, and select python.exe, (3.7), what I already installed, but again the same error,
The terminal is complaining about gaps in your path. When working with a programming language, it is good not to leave gaps in your path. Instead of FALAH FAKHRI, it can be changed to FALAH_FAKHRI.
It also complains about vs2010_runtime conflict. I think this might be the Microsof visual C++ redistribution pacakge which is required for some applications on your PC. I do not know if you download a new version of this will solve the problem (https://www.microsoft.com/en-gb/download/details.aspx?id=5555).
If you cannot manage to make it work with anacoda, i would suggest you to use pipenv as an alternative. pipenv is teh official recommended python packaging tool. It resolves all the issues regarding python package versions.
Right, first of all, before starting creating virtual environments, we need to make sure that you have configured snappy correctly. I suspect that snappy has not been configured correctly. Let’s make sure that the steps you followed for the configuration are correct.
Install SNAP and configure it with python 3
Install python 3.4 in your system.: Unfortunately, snappy does not work with the latest version of python. Python 3.4 does not provide a windows installer, hence, we need to build it from source. To do that, we need to perform the following steps:
Scroll all the way down on the bottom and click on Gzipped source tarball
unzip the folder
go inside the folder you downloaded: Python-3.4.5 and open a terminal
type: ../configure --with-pydebug
type: make
type: make test
There is also a README file in the folder telling you how to build python.
snappy configuration
cd snap/bin
./snappy-conf ‘full path of python interpreter’. Find the python 3.4.5 installation path and paste it next to snappy-conf.
Hopefully, these steps will work for you. Trying to work with programming languages in windows is bit nightmare compare to linux. It requires lots of effort.
Thanks a lot for very nice instructions, However, I didn’t succeed to go further than, the highlighted readme makes the the issue more complicated for me, but what I did is following your smooth nice instructions.
your path C:\Windows\system32, it looks like the system32 stars with lower case ‘s’. I do not know your windows path names but looking all of your paths it seems that system32 should start with capital ‘S’.
Might worth changing C:\Windows\system32 to C:\Windows\System32. and try to build the python from source
If again this does not work, it might need an update version of java