Install sklearn module on Python

We are running a stata code on baobab that uses a the command “ddml” which calls a python package :
// now check that sklearn is available
cap python which sklearn
if _rc > 0 {
local dostata = 1
`qui’ di as res “Python module sklearn not available; using Stata -nl-…”
ad we get this error in the log file in baobab:
File “”, line 1, in
ModuleNotFoundError: No module named ‘sklearn’
(176 lines skipped)
(error occurred while loading _ddml_nnls.ado)

Can you provide any help?

Thank you


please try to load the scikit-learn module before:

(baobab)-[sagon@login2 ~]$ ml GCC/12.3.0 scikit-learn/1.3.1 Stata/18