I have appended path like this.
sys.path.append('C:\Users\My Pc\Anaconda2\Lib\site-packages')
where my pysptools package is installed.I am want t use its classification module.so i imported it like this.
When the plugin is loaded it gives error like below.When i am individually doing this in spyder it does not gives any error.but when i am calling it in qgis it gives error. ```
Couldn't load plugin HyperspectralClassifier due to an error when calling its classFactory() method
ImportError: DLL load failed: %1 is not a valid Win32 application. ___________________________________________________________________________ Contents of C:\Users\My Pc\Anaconda2\Lib\site-packages\sklearn__check_build: setup.py setup.pyc check_build.pyd init.py init.pyc ___________________________________________________________________________ It seems that scikit-learn has not been built correctly. If you have installed scikit-learn from source, please do not forget to build the package before using it: run python setup.py install or `make` in the source directory. If you have used an installer, please check that it is suited for your Python version, your operating system and your platform.
Traceback (most recent call last):
File "C:/PROGRA2/QGIS21.18/apps/qgis/./python\qgis\utils.py", line 333, in startPlugin
plugins[packageName] = package.classFactory(iface)
File "C:/Users/My Pc/.qgis2/python/plugins\HyperspectralClassifier_init.py", line 34, in classFactory
from .hyperspectral_classifier import HyperspectralClassifier
File "C:/PROGRA2/QGIS21.18/apps/qgis/./python\qgis\utils.py", line 607, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:/Users/My Pc/.qgis2/python/plugins\HyperspectralClassifier\hyperspectral_classifier.py", line 34, in
import pysptools.classification as cl
File "C:/PROGRA2/QGIS21.18/apps/qgis/./python\qgis\utils.py", line 607, in _import
mod = builtin_import(name, globals, locals, fromlist, level)
File "C:\Users\My Pc\Anaconda2\Lib\site-packages\pysptools\classification_init.py", line 5, in
from .km import KMeans
File "C:/PROGRA2/QGIS21.18/apps/qgis/./python\qgis\utils.py", line 607, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\Users\My Pc\Anaconda2\Lib\site-packages\pysptools\classification\km.py", line 26, in
import sklearn.cluster as cluster
File "C:/PROGRA2/QGIS21.18/apps/qgis/./python\qgis\utils.py", line 607, in _import
mod = builtin_import(name, globals, locals, fromlist, level)
File "C:\Users\My Pc\Anaconda2\Lib\site-packages\sklearn_init.py", line 56, in
from . import __check_build
File "C:/PROGRA2/QGIS21.18/apps/qgis/./python\qgis\utils.py", line 607, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\Users\My Pc\Anaconda2\Lib\site-packages\sklearn_check_build_init.py", line 46, in
raise_build_error(e)
File "C:\Users\My Pc\Anaconda2\Lib\site-packages\sklearn_check_build_init.py", line 41, in raise_build_error
%s""" % (e, local_dir, ''.join(dir_content).strip(), msg))
ImportError: DLL load failed: %1 is not a valid Win32 application.
Contents of C:\Users\My Pc\Anaconda2\Lib\site-packages\sklearn__check_build:
setup.py setup.pyc _check_build.pyd
init.py init.pyc
It seems that scikit-learn has not been built correctly.
If you have installed scikit-learn from source, please do not forget
to build the package before using it: run python setup.py install or
make in the source directory.
If you have used an installer, please check that it is suited for your
Python version, your operating system and your platform.
Python version: 2.7.4 (default, Apr 6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)]
QGIS version: 2.18.4 Las Palmas, 59c1d21
Python Path:
C:/PROGRA2/QGIS21.18/apps/qgis/./python/plugins\processing
C:/PROGRA2/QGIS21.18/apps/qgis/./python
C:/Users/My Pc/.qgis2/python
C:/Users/My Pc/.qgis2/python/plugins
C:/PROGRA2/QGIS21.18/apps/qgis/./python/plugins
C:\PROGRA2\QGIS21.18\apps\Python27\lib\site-packages\matplotlib-1.3.1-py2.7-win32.egg
C:\PROGRA2\QGIS21.18\bin\python27.zip
C:\PROGRA2\QGIS21.18\apps\Python27\DLLs
C:\PROGRA2\QGIS21.18\apps\Python27\lib
C:\PROGRA2\QGIS21.18\apps\Python27\lib\plat-win
C:\PROGRA2\QGIS21.18\apps\Python27\lib\lib-tk
C:\PROGRA2\QGIS21.18\bin
C:\PROGRA2\QGIS21.18\apps\Python27
c:\progra2\qgis21.18\apps\python27\lib\site-packages\jinja2-2.7.2-py2.7.egg
c:\progra2\qgis21.18\apps\python27\lib\site-packages\markupsafe-0.23-py2.7-win32.egg
c:\progra2\qgis21.18\apps\python27\lib\site-packages\python_dateutil-2.2-py2.7.egg
c:\progra2\qgis21.18\apps\python27\lib\site-packages\pytz-2014.2-py2.7.egg
c:\progra2\qgis21.18\apps\python27\lib\site-packages\shapely-1.2.18-py2.7-win32.egg
C:\PROGRA2\QGIS21.18\apps\Python27\lib\site-packages
C:\PROGRA2\QGIS21.18\apps\Python27\lib\site-packages\PIL
C:\PROGRA2\QGIS21.18\apps\Python27\lib\site-packages\win32
C:\PROGRA2\QGIS21.18\apps\Python27\lib\site-packages\win32\lib
C:\PROGRA2\QGIS21.18\apps\Python27\lib\site-packages\Pythonwin
C:\PROGRA2\QGIS21.18\apps\Python27\lib\site-packages\wx-2.8-msw-unicode
C:/Users/My Pc/.qgis2//python
C:\Users\My Pc\Anaconda2\Lib\site-packages
C:\Users\My Pc\Anaconda2\Lib\site-packages
C:\Users\My Pc\Anaconda2\Lib\site-packages
What is the problem?other module of pysptools such as spectro i used in the qgis like above.but when i am importing classification it gives error.
I have appended path like this.
sys.path.append('C:\Users\My Pc\Anaconda2\Lib\site-packages')where my pysptools package is installed.I am want t use its classification module.so i imported it like this.
When the plugin is loaded it gives error like below.When i am individually doing this in spyder it does not gives any error.but when i am calling it in qgis it gives error. ```
Couldn't load plugin HyperspectralClassifier due to an error when calling its classFactory() method
ImportError: DLL load failed: %1 is not a valid Win32 application. ___________________________________________________________________________ Contents of C:\Users\My Pc\Anaconda2\Lib\site-packages\sklearn__check_build: setup.py setup.pyc check_build.pyd init.py init.pyc ___________________________________________________________________________ It seems that scikit-learn has not been built correctly. If you have installed scikit-learn from source, please do not forget to build the package before using it: run
python setup.py installor `make` in the source directory. If you have used an installer, please check that it is suited for your Python version, your operating system and your platform.Traceback (most recent call last):
File "C:/PROGRA
2/QGIS21.18/apps/qgis/./python\qgis\utils.py", line 333, in startPluginplugins[packageName] = package.classFactory(iface)
File "C:/Users/My Pc/.qgis2/python/plugins\HyperspectralClassifier_init.py", line 34, in classFactory
from .hyperspectral_classifier import HyperspectralClassifier
File "C:/PROGRA
2/QGIS21.18/apps/qgis/./python\qgis\utils.py", line 607, in _importmod = _builtin_import(name, globals, locals, fromlist, level)
File "C:/Users/My Pc/.qgis2/python/plugins\HyperspectralClassifier\hyperspectral_classifier.py", line 34, in
import pysptools.classification as cl
File "C:/PROGRA
2/QGIS21.18/apps/qgis/./python\qgis\utils.py", line 607, in _importmod = builtin_import(name, globals, locals, fromlist, level)
File "C:\Users\My Pc\Anaconda2\Lib\site-packages\pysptools\classification_init.py", line 5, in
from .km import KMeans
File "C:/PROGRA
2/QGIS21.18/apps/qgis/./python\qgis\utils.py", line 607, in _importmod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\Users\My Pc\Anaconda2\Lib\site-packages\pysptools\classification\km.py", line 26, in
import sklearn.cluster as cluster
File "C:/PROGRA
2/QGIS21.18/apps/qgis/./python\qgis\utils.py", line 607, in _importmod = builtin_import(name, globals, locals, fromlist, level)
File "C:\Users\My Pc\Anaconda2\Lib\site-packages\sklearn_init.py", line 56, in
from . import __check_build
File "C:/PROGRA
2/QGIS21.18/apps/qgis/./python\qgis\utils.py", line 607, in _importmod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\Users\My Pc\Anaconda2\Lib\site-packages\sklearn_check_build_init.py", line 46, in
raise_build_error(e)
File "C:\Users\My Pc\Anaconda2\Lib\site-packages\sklearn_check_build_init.py", line 41, in raise_build_error
%s""" % (e, local_dir, ''.join(dir_content).strip(), msg))
ImportError: DLL load failed: %1 is not a valid Win32 application.
Contents of C:\Users\My Pc\Anaconda2\Lib\site-packages\sklearn__check_build:
setup.py setup.pyc _check_build.pyd
init.py init.pyc
It seems that scikit-learn has not been built correctly.
If you have installed scikit-learn from source, please do not forget
to build the package before using it: run
python setup.py installormakein the source directory.If you have used an installer, please check that it is suited for your
Python version, your operating system and your platform.
Python version: 2.7.4 (default, Apr 6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)]
QGIS version: 2.18.4 Las Palmas, 59c1d21
Python Path:
C:/PROGRA
2/QGIS21.18/apps/qgis/./python/plugins\processingC:/PROGRA
2/QGIS21.18/apps/qgis/./pythonC:/Users/My Pc/.qgis2/python
C:/Users/My Pc/.qgis2/python/plugins
C:/PROGRA
2/QGIS21.18/apps/qgis/./python/pluginsC:\PROGRA
2\QGIS21.18\apps\Python27\lib\site-packages\matplotlib-1.3.1-py2.7-win32.eggC:\PROGRA
2\QGIS21.18\bin\python27.zipC:\PROGRA
2\QGIS21.18\apps\Python27\DLLsC:\PROGRA
2\QGIS21.18\apps\Python27\libC:\PROGRA
2\QGIS21.18\apps\Python27\lib\plat-winC:\PROGRA
2\QGIS21.18\apps\Python27\lib\lib-tkC:\PROGRA
2\QGIS21.18\binC:\PROGRA
2\QGIS21.18\apps\Python27c:\progra
2\qgis21.18\apps\python27\lib\site-packages\jinja2-2.7.2-py2.7.eggc:\progra
2\qgis21.18\apps\python27\lib\site-packages\markupsafe-0.23-py2.7-win32.eggc:\progra
2\qgis21.18\apps\python27\lib\site-packages\python_dateutil-2.2-py2.7.eggc:\progra
2\qgis21.18\apps\python27\lib\site-packages\pytz-2014.2-py2.7.eggc:\progra
2\qgis21.18\apps\python27\lib\site-packages\shapely-1.2.18-py2.7-win32.eggC:\PROGRA
2\QGIS21.18\apps\Python27\lib\site-packagesC:\PROGRA
2\QGIS21.18\apps\Python27\lib\site-packages\PILC:\PROGRA
2\QGIS21.18\apps\Python27\lib\site-packages\win32C:\PROGRA
2\QGIS21.18\apps\Python27\lib\site-packages\win32\libC:\PROGRA
2\QGIS21.18\apps\Python27\lib\site-packages\PythonwinC:\PROGRA
2\QGIS21.18\apps\Python27\lib\site-packages\wx-2.8-msw-unicodeC:/Users/My Pc/.qgis2//python
C:\Users\My Pc\Anaconda2\Lib\site-packages
C:\Users\My Pc\Anaconda2\Lib\site-packages
C:\Users\My Pc\Anaconda2\Lib\site-packages