I am starting using reticulate
package that allows using Python within R environment and wanted to perform mean-shift clustering with sklearn
. So here's my attempt:
> library(reticulate)
> np <- import('numpy')
> sklearn <- import('sklearn')
> sklearn.MeanShift <- sklearn$cluster$MeanShift
> x <- matrix(rnorm(20), 10, 2)
> sklearn.MeanShift(x)
Error in py_call_impl(callable, dots$args, dots$keywords) :
Evaluation error: Required version of NumPy not available: installation of Numpy >= 1.6 not found.
As you can see, numpy
was not found while calling sklearn
function while it is imported without a problem with reticulate::import
. I have also checked the version of numpy
I have in conda prompt and it is 1.15.4. Also py_numpy_available()
returns false. My reticulate
config are:
python: C:\Users\jakes\ANACON~1\python.exe
libpython: C:/Users/jakes/ANACON~1/python37.dll
pythonhome: C:\Users\jakes\ANACON~1
version: 3.7.1 (default, Oct 28 2018, 08:39:03) [MSC v.1912 64 bit (AMD64)]
Architecture: 64bit
numpy: [NOT FOUND]
scikit-learn: [NOT FOUND]
python versions found:
C:\Users\jakes\ANACON~1\python.exe
C:\Users\jakes\Anaconda3\python.exe
How can I fix this issue?