Hi,
this is my script:
import time
import datetime
from datetime import date
import panel as pn
import numpy as np
import pandas as pd
import seaborn
from panel.widgets import Tqdm
from awesome_panel_extensions.widgets.progress_ext import ProgressExt
pn.extension()
radio_group = pn.widgets.RadioButtonGroup(
name='Select', options=['A', 'B'], button_type='success')
radio_group
text = pn.widgets.TextInput(value='Ready')
x = 1
y = 2
button = pn.widgets.Button(name='Run!', button_type='primary')
def b(event):
if radio_group.value == 'A':
text.value ='Calculating A'
exec(open('A.py').read())
text.value = 'Finished with A'
elif radio_group.value == 'B':
text.value = 'Calculating B'
exec(open('B.py').read())
text.value = 'Finished with B'
button.on_click(b)
pn.Row(button, text)
template = pn.template.FastListTemplate(
title='XX!',
sidebar=[pn.pane.Markdown("Choose which Calculation you want to run"),
radio_group,
pn.Row(button, text),
],
)
template.servable();
A.py and B.py create some folders, read some input files, do some calculations on them and store the results in the outputfolder, e.g. a folder name âoutput/B/corrected_raw_data/â and stores files in there.
When I click the button within Jupyter or execute âB.pyâ in the cli, everything works fine.
However, when I serve it with panel and then hit the button Iâll get this error:
IsADirectoryError: [Errno 21] Is a directory: â/home/user/output/B/corrected_raw_data/â
It seems that panel cannot read the input data. Probably permission related?
Any ideas?
edit:
inserting
try:
open('/home/user/input/2023.06.02/230306 002_Blk.TXT','r')
print('Succes')
except IOError:
print("The file cannot be opened")
in the âelifâ-part I get as result:
Succes
when running in jupyterlab.
Pressing the button on panel I get this error message in my cli:
The file cannot be opened
So I think this is the problem:
User authentication hooks NOT provided (default user enabled)
How can I start panel using my default linux user?