I wrote a Dash program using python and it works on Jupyter notebook. But It doesn't work on server. I send my geometric data on server by: scp data.json username@10.0.0.0:/directory
Why in server I cant run this python code:
import pandas as pd
import geopandas as gpd
import json
import dash
import swifter
import dash_html_components as html
import dash_core_components as dcc
from dash.dependencies import Input, Output
import plotly.express as px
import plotly.graph_objects as go
df= gpd.read_file('data.json').to_crs("EPSG:4326")
upper_bound = df.swifter.apply(lambda row: norm.cdf(5,loc= row['p_mean'],scale=row['p_std']),axis=1)
app = dash.Dash()
server = app.server
app.layout = html.Div([
dcc.RangeSlider(
id='range-slider',
className='range-slider' ,
min=0, max=3,
step=None,
marks={
0: {'label': df.name.iloc[0]},
1: {'label':df.name.iloc[1]},
2: {'label':df.name.iloc[2]},
3: {'label':df.name.iloc[3]}
},
value=[0, 1] )
])
if __name__ == '__main__':
app.run_server(debug=True)
Because I want to speed up calculating "norm" , I was used "swifter". It works on PC but it doesn't work on server! After removing that, It works!