Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

249
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda