<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 28, 2014 at 3:08 AM, Christina Ludwig <span dir="ltr"><<a href="mailto:christina_ludwig@gmx.net" target="_blank">christina_ludwig@gmx.net</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi everyone,<br>
<br>
I just started using GRASS GIS and I would like to use the v.class.mlpy extension. So I successfully installed numpy, scipy and mlpy and when I import them in Python they all seem to work fine. However, when I try to install the v.class.mlpy extension using "g.extension extension=v.class.mlpy" I get the following error message:<br>


<br>
"Cannot import mlpy (<a href="http://mlpy.sourceforge.net" target="_blank">http://mlpy.sourceforge.net</a>) library. Please install it or ensure that it is on path. (use PYTHONPATH variable)."<br>
<br>
The mlpy folder (/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mlpy/) is on my PYTHONPATH and if I start Python in the terminal and import mlpy everything works fine.<br>
<br>
If I try to directly import mlpy in the GRASS GIS Python shell I get the following message:<br>
<br>
Python 2.7.8 (v2.7.8:ee879c0ffa11, Jun 29 2014, 21:07:35)<br>
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin<br>
Type "help", "copyright", "credits" or "license" for more information.<br>
import mlpy<br>
Traceback (most recent call last):<br>
  File "<input>", line 1, in <module><br>
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mlpy/__init__.py", line 18, in <module><br>
    import gsl<br>
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mlpy/gsl.so, 2): Symbol not found: _gsl_sf_fact<br>
  Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mlpy/gsl.so<br>
  Expected in: flat namespace<br>
 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mlpy/gsl.so<br>
<br>
Does anybody know what might be the problem? I would greatly appreciate any help!! :)<br>
<br></blockquote><div>I don't know where is the problem. It seems that Python environment is somehow broken in GRASS session. This might be due to the different ways how software is installed on Mac.<br><br></div><div>

To understand the problem more, you can try to run python from standard command line but in GRASS GIS session (i.e. not from the GUI). You can also check PYTHONPATH environmental variable there. Compare also values of DYLD_LIBRARY_PATH environmental variable. Also Python variable sys.executable might be interesting.<br>

<br></div><div>Note that there is also <a href="http://v.class.ml">v.class.ml</a> module which has richer but different functionality and can use also scikit-learn library.<br><br><a href="http://svn.osgeo.org/grass/grass-addons/grass7/vector/v.class.ml/v.class.ml.html">http://svn.osgeo.org/grass/grass-addons/grass7/vector/v.class.ml/v.class.ml.html</a><br>

<a href="http://scikit-learn.org/stable/">http://scikit-learn.org/stable/</a><br><br></div><div>Vaclav<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">


<br>
Cheers,<br>
Christina<br>
<br>
<br>
<br>
_______________________________________________<br>
grass-user mailing list<br>
<a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-user</a><br>
</blockquote></div><br></div></div>