0

I want to run random forest classification from Dzetsaka plugin on QGIS 3.4.7 but I can't as a message appears as following:

Scikit-learn library is missing on your computer. You must use Gaussian Mixture Model, or consult dzetsaka homepage to learn on to install the missing library.

I installed scikit-learn in the following way: Open OsGeo shell, then :

py3_env.bat
python3 -m pip install scikit-learn --user

The following messages appears:

Requirement already satisfied: scikit-learn in c:\users\gugir\appdata\roaming\python\python37\site-packages (0.22) Requirement already satisfied: joblib>=0.11 in c:\users\gugir\appdata\roaming\python\python37\site-packages (from scikit-learn) (0.14.0) Requirement already satisfied: numpy>=1.11.0 in c:\progra~1\qgis3~1.4\apps\python37\lib\site-packages (from scikit-learn) (1.15.4) Requirement already satisfied: scipy>=0.17.0 in c:\progra~1\qgis3~1.4\apps\python37\lib\site-packages (from scikit-learn) (1.1.0)

So it seems that scikit-learn is present on my computer, but still I can't run random forest classification form dzetsaka plugin. What can I do?

1 Answer 1

1

Requirement already satisfied: scikit-learn in c:\users\gugir\appdata\roaming\python\python37\site-packages (0.22) Requirement already satisfied: joblib>=0.11 in c:\users\gugir\appdata\roaming\python\python37\site-packages (from scikit-learn) (0.14.0)

Your package has been installed on your native python and not on the QGIS python. For each python, you have a "site-packages" folder with the list of installed packages.

To solve the problem, you must use pip or python3 from QGIS. Sometimes the problem persists and the package does not install in the right place. As a last resort, you can copy the packages from the native Python "site-packages" folder to the "site-packages" folder of your Python for QGIS.

2
  • Thank you. How do i do that? I tried to copy the packages from native python to qgis python but nothing changed. I am not sure i am copying the folder in the proper path.
    – agrullo
    Commented Dec 20, 2019 at 9:51
  • You copy the 'site-packages' folder of Python to the 'site-packages' folder of Python for QGIS. Commented Dec 20, 2019 at 11:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.