Open wdesaintjean opened 1 month ago
I ran your code in a devcontainer with Python 3.12.4 and Shiny, and it worked without any issues. This suggests the problem might not be with this snippet specifically, but rather with the overall structure of your code.
My test: App.py
from shiny import reactive
from shiny.express import input, render, ui
ui.panel_title("Exploration of Nanopore RNAseq results")
ui.input_text("gene_name", "Gene name Symbol", "Enter gene")
ui.input_action_button("action_button", "Search", disabled=False)
@render.text
@reactive.event(input.action_button)
def txt():
#gene_conv=pl.read_csv("./data/geneToSymbol_GRCm38.99.csv", separator="\t", has_header = False)
if input.gene_name() in ['ok', 'ok2']:
return f"The chosen gene is {input.gene_name()}"
else:
return f"The gene symbol is not in mm10 reference"
devcontainer.json
{
"name": "test",
"build": {
"dockerfile": "Dockerfile",
"context": ".."
},
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"Posit.shiny",
"ms-azuretools.vscode-docker",
],
"settings": {"python.defaultInterpreterPath": "/usr/local/bin/python"}
}
}
}
Dockerfile:
FROM python:3.12.4
RUN apt-get -y update && apt-get -y upgrade
WORKDIR /
RUN pip install shiny
COPY . .
Thank you for your answer, I rewrite my code only in shiny core and its working. The problem can came from our installation on the server or from the python version used ( 3.10) I will investigate.
Thank you again for testing my code.
Hello I wrote an app in shiny express python, and its worked well in a local server on my computer. But when I try to install my app on a server, (with a docker image, and irequired python packages), I have an error that said:
It seems to not accept the utilization of @reactive.event() in a shiny express application, but I saw in the documentation that the reactive module is unchanged between Core and Express. I don't understand the problem. Here the problematic part of my code:
What's bug me is that worked perfectly fine on my computer with manual import of python packages. I suppose I can always convert my code in Shiny Core python, but it will be a lot of works, I will gain a lot of time if It 's only a little mistake.
Can you help me?