I wish to use scikit-learn Python machine learning library inside PostgreSQL plpython3u language functions. The easisest way to install scikit-learn (along with prerequisite NumPy and SciPy) is to install Anaconda.
Anaconda comes with built-in Python 3.5. However, PostgreSQL 9.5 EnterpriseDB installer installs PostgreSQL that requires Python 3.3 and does not utilize Anaconda with Python 3.3.
What is the way to go in order to enable using scikit-learn inside plpython3u PostgreSQL funtions?
a) Can I force PostgreSQL plpython3u to work with Python 3.5?
b) Can I force Anaconda to use Python 3.3 instead Python 3.5?
c) Is there any other solution to enable scikit-learn in PostgreSQL?
You need to install scilit-learn against the Python-3.3 distribution provided in EnterpriseDB's LanguagePack installer.
You can get it from StackBuilder GUI installer, and post-installation set up can be found here.
Then you need to install NumPy, SciPy and scikit-learn with pip
command provided by LanguagePack python.