繁体   English   中英

PythonShellError:ModuleNotFoundError:没有名为“pandas”的模块

[英]PythonShellError: ModuleNotFoundError: No module named 'pandas'

我已经安装了 pandas 但是在尝试使用 python Z2591C98B70124BFC6B7EE9A3B755DDZ 脚本从 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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM