I am working on a Windows computer of my company and I want to use Scikit-Learn in an ArcMap Python Toolbox. Is this possible? If so, how can I install it?
For smaller packages that are exclusively written in Python, I managed to just make a local copy of the Package and to add it using
sys.path.append()
However, this did not work for Scikit-Learn.
If possible, I would not only use Scikit-Learn but also distribute it along with the Toolbox.
Solved! Go to Solution.
You will need ArcGIS Pro to work with a suitable conda environment. ArcMap isn't being upgraded any further so you might want to switch to it for those functions that can't or can no longer be done in ArcMap and its environments.
Also, many science, ml and ai packages no longer support python <= 3.8 and plans are in the works to abandon 3.9 in the near-ish future so moving forward may be your best option.
arcmap == python 2.7, scikit-learn may have dropped support for its newest versions. so give the conda package manager a try. If it looks good, drop the --dry-run portion (which just says what it is going to do without actually doing it)
>>> conda install scikit-learn --dry-run
Unfortunately, it only finds scikit-learn==0.20.4 which apparently does not work with numpy==0.9.3 (upon import, it fails with ValueError: numpy.dtype has the wrong size, try recompiling. Expected 52, got 56) and pip cannot downgrade numpy...
You will need ArcGIS Pro to work with a suitable conda environment. ArcMap isn't being upgraded any further so you might want to switch to it for those functions that can't or can no longer be done in ArcMap and its environments.
Also, many science, ml and ai packages no longer support python <= 3.8 and plans are in the works to abandon 3.9 in the near-ish future so moving forward may be your best option.