0

Following code works fine on Windows 10 (Python 3.7.4) but does "Segmentation fault (core dumped)" when run on Ubuntu 19.2 at point of plotting (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)

....
  • https://stackoverflow.com/questions/13654449/error-segmentation-fault-core-dumped –  Dec 15 '19 at 19:18

1 Answers1

0

I updated all my python modules on the ubuntu client to: Python 3.7.5:: Flask (1.1.1) Flask-APScheduler (1.11.0) flask-marshmallow (0.10.1) Flask-SQLAlchemy (2.4.1) .... pandas (0.25.3) .... Pillow (6.2.1)

Now its working.