Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/42.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PythonShellError:ModuleNotFoundError:没有名为';熊猫';_Python_Node.js - Fatal编程技术网

PythonShellError:ModuleNotFoundError:没有名为';熊猫';

PythonShellError:ModuleNotFoundError:没有名为';熊猫';,python,node.js,Python,Node.js,我已经安装了pandas,但是在尝试使用pythonshell从nodejs运行python脚本时,它仍然没有显示任何模块 const route = require('express').Router(); const { ensureAuthenticated, forwardAuthenticated } = require('../config/auth'); const { PythonShell } = require('python-shell'); const path = re

我已经安装了pandas,但是在尝试使用pythonshell从nodejs运行python脚本时,它仍然没有显示任何模块

const route = require('express').Router();
const { ensureAuthenticated, forwardAuthenticated } = require('../config/auth');
const { PythonShell } = require('python-shell');
const path = require('path');

route.post('/report', (req, res) => {
  var myPythonScriptPath = path.join(__dirname + '/report_gen.py');
  var pyshell = new PythonShell(myPythonScriptPath);
  var message = req.body.zone;
  pyshell.on('message', function (message) {
    res.send({ msg: message });
  });
});

在代码的开头需要这一行

import pandas as pd

您是否在nodejs使用的python环境中安装了pandas?