以下代码在Windows 10(Python 3.7.4)上运行良好,但在Ubuntu 19.2的绘图点(Python 3.6.8)上运行时会出现“分段错误(核心转储)”:
from flask import Flask, request, render_template, redirect, send_file
import pandas as pd
import os, psutil, math, subprocess
....
@app.route('/plott/d/<n>/<dp>')
def plottd(n,dp):
dft = dft[dft.dp.eq(dp)]
if dft.shape[0] >= 2:
dft['value'] = dft['value'].astype(float)
plot_fig = dft.plot(x='timestamp',y='value', kind = 'line', title="test")
plot_fig.grid('on')
fn = 'static/'+str(dp)+'.png'
plot_fig.get_figure().savefig(fn)
return send_file(fn, mimetype='image/png')
return "not enough values for plott/d " + str(dp)
....
我更新了ubuntu客户端上的所有python模块: Python 3.7.5:: 烧瓶(1.1.1) 调度程序(1.11.0) 瓶装棉花糖(0.10.1) 炼金术(2.4.1) .... 熊猫(0.25.3) .... 枕头(6.2.1)
现在开始工作了
相关问题 更多 >
编程相关推荐