ModuleNotFoundError: No module named 'sklearn'

Hi Dear I am having an issue trying to deploy my machine learning model built using pythonShell and NodeJs. Here are a screenshot of the code

This is a code fragment on how I created the API endpoint and plugged it into my NodeJs.

in my index.js file, I wrote this code“/api/Jn_model”, function (req, res) {

const description = req.body.description;

const options = {

    args: description
}'python-code/', options)

.then(messages => {
            "predictions": messages


In my python-code/, I am calling my saved pickle model
import pickle
import sys

with open(‘models/ababoost_Jn.pkl’,‘rb’) as f:
Jn_model = pickle.load(f)
pred = Jn_model.predict([[sys.argv[1]]])

In my AlpineJs file where I am making use of alpine, this is how I am sending it to my frontend index.html
.post(“/api/Jn_model”, {
description: parseInt(this.value_Jn),
.then((res) => {
let val =[0];
val = val.split(“[”)[1];
val = val.split(“]”)[0];
this.JnVal =
"Based on your input, the predicted Jn value is " +
// this.getRecord();
setTimeout(() => (this.JnVal = “”), 30000);

All the variables for the alpineJs have been declared and locally it is working perfectly well. I created a requirements.txt (which contains scikit-learn and every other possible requirements) file and pip install requirements.txt in my package.json to tell render to install the requirements.

After pushing to github and connect on render, I keep getting this error

“ModuleNotFoundError: No module named ‘sklearn’\n”,
executable: ‘python3’,
options: null,

Please if anyone has ever come across such an error, I would appreciate the help.

Hi Fabchi,

I’ll respond to the ticket you opened on this topic as well. Lets continue the discussion there to avoid confusing duplicate threads.



I have the same problem. What to do?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.