Error when running Python script, no sklearn or scikit-learn

06-01-2020 09:16 AM
New Contributor

I am working on the Predicting Seagrass Tutorial and at the Python section, I keep getting the error that  no module exsists for sklearn and for scikit-learn (that I downloaded and replaced for sklearn after the first error).  Can someone help?  I can't find sklearn to download in the modules after is the error.  I did replace sklearn with scikit-learn and tried different sytax as well.

from scikit-learn.ensemble import RandomForestClassifier
import numpy as NUM
import arcpy as ARCPY
import arcpy.da as DA
import pandas as PD
import seaborn as SEA
import matplotlib.pyplot as PLOT
import arcgisscripting as ARC
import SSUtilities as UTILS
import os as OS
File "<string>", line 1
from scikit-learn.ensemble import RandomForestClassifier

0 Kudos
1 Reply
New Contributor

You'll need to do a couple of things to get 

First, you will need to create a cloned environment: Work with Python environments—ArcGIS Pro | Documentation

Then, using this cloned environment you can go into the Python manager in ArcGIS Pro and add any of the listed packages like scikit-learn or scikit-learn.ensemble(or add ones that are not listed)

0 Kudos