Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

253
Views
Node.js, Child_process running a python script pandas import error

Can someone please explain why this is the case and how this issue can be fixed?

If i boot my Node.js server via docker using docker compose up -d

I'm sending data to my server via a vue form and receiving it via this.

app.post('/', upload.single('file'),(req, res) =>{

    
    converter.json2csv(req.body, (err, csv) => {
        if (err) {
            throw err;
        }
    
        // print CSV string
        console.log(csv);
        fs.writeFileSync('./uploads/file.csv', csv)
    });
    var spawn = require('child_process').spawn;
    var process = spawn('python', ['./uploads/classify.py']);
    
    process.stderr.on('data', function (data) {
        console.log(data.toString())
    });

})

The error i get is

Traceback (most recent call last):

File "./uploads/classify.py", line 52, in <module>



import pandas as pd



ImportError: No module named pandas

Note: if I change stderr to stdout nothing happens (to be expected)

However if I boot via Node index.js i dont run into this error and everything is fine however my website doesn't work properly.

Is there a way that I can still boot my server via docker compose up -d and not get pandas as pd is missing instead of booting via node index.js

I have also tried using the npm package python-shell and I get pandas as pd module is missing as well

Are there any other packages or methods to help port a python script to node?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!