[GRASS-user] problems with r.learn.ml and python 3.7

Jonathan Aguero jaguero.ucr at gmail.com
Sun Jun 23 19:07:23 PDT 2019


Dear GRASS users,
I am having problems to use r.learn.ml. I am using OSGeo win10 version
(7.6.1)
I installed scikit-learn using pip:

C:\>python3 -m pip install scikit-learn

Requirement already satisfied: scikit-learn in
c:\osgeo4w64\apps\python37\lib\site-packages (0.21.2)

Requirement already satisfied: scipy>=0.17.0 in
c:\osgeo4w64\apps\python37\lib\site-packages (from scikit-learn) (1.1.0)

Requirement already satisfied: numpy>=1.11.0 in
c:\osgeo4w64\apps\python37\lib\site-packages (from scikit-learn) (1.16.3)

Requirement already satisfied: joblib>=0.11 in
c:\osgeo4w64\apps\python37\lib\site-packages (from scikit-learn) (0.13.2)

But when I ran the r.learn.ml I got this message:

r.learn.ml group=lsat7_2000 trainingmap=landclass96_roi
output=rf_classification classifier=RandomForestClassifier n_estimators=500

ERROR: Scikit learn 0.18 or newer is not installed

(Sat Jun 22 13:55:02 2019) Command finished (4 sec)

I modified the python-core.bat file to point to python 3.7 this way:

SET PYTHONHOME=%OSGEO4W_ROOT%\apps\Python37
PATH %OSGEO4W_ROOT%\apps\Python37\Scripts;%PATH%

But GRASS is still using Python 2.7 as shown in the Python shell:
Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:25:58) [MSC v.1500 64
bit (AMD64)] on win32

How can I make sure GRASS uses Python 3.7

Thanks in advance.

Jonathan Aguero-Valverde
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20190623/73261add/attachment.html>


More information about the grass-user mailing list