S
Solara

general

I m using IntelliJ

IIftah6/28/2023
I'm using IntelliJ
MMaartenBreddels6/28/2023
you can probably add a python debugger from the ide, so you have to configure intellj how to start up solara
Mmariobuikhuizen6/28/2023
@MaartenBreddels do you have an example how to start solara from a .py file? You can select debug on a .py file from intellij
MMaartenBreddels6/28/2023
but you should be able to tell intellij how to add a new way to start a program right, like normally you say it to run some specific python because, we don't have a solara.run method (yet)
Mmariobuikhuizen6/28/2023
It specifically needs the script file, I haven't found another way yet.
MMaartenBreddels6/28/2023
Stack Overflow
How to run/debug a streamlit application from an IDE
I really like streamlit as an environment for research. Mixing a notebook/dashboard-like output I can design quickly with pure code for its definition (no cells etc.) as well as the ability to infl...
MMaartenBreddels6/28/2023
python -m solara run <script> also works
MMaartenBreddels6/28/2023
https://stackoverflow.com/a/73328328/5397207 this answer describes it i think
Stack Overflow
How to run/debug a streamlit application from an IDE
I really like streamlit as an environment for research. Mixing a notebook/dashboard-like output I can design quickly with pure code for its definition (no cells etc.) as well as the ability to infl...
Mmariobuikhuizen6/28/2023
I think <script> will be filled in by intellij
IIftah6/28/2023
I have it almost working, intelliJ is running Solara, and it loads the module, the breakpoint stops - all is well except... it doesn't work. The browser shows: "A widget with mount-id="solara-main" should go here" This is the shell execution that IntelliJ is running:
/Users/iftah/.virtualenvs/play/bin/python /Users/iftah/Library/Application Support/JetBrains/IntelliJIdea2022.3/plugins/python/helpers/pydev/pydevd.py --multiprocess --qt-support=auto --client 127.0.0.1 --port 62236 --file /Users/iftah/.virtualenvs/play/bin/solara run /Users/iftah/devel/play_project/src/ui/main.py
/Users/iftah/.virtualenvs/play/bin/python /Users/iftah/Library/Application Support/JetBrains/IntelliJIdea2022.3/plugins/python/helpers/pydev/pydevd.py --multiprocess --qt-support=auto --client 127.0.0.1 --port 62236 --file /Users/iftah/.virtualenvs/play/bin/solara run /Users/iftah/devel/play_project/src/ui/main.py
the src/ui/main.py has the Page setup and it does stop there in a breakpoint
Mmariobuikhuizen6/28/2023
The widget is not send to the frontend because the debugger is pauzed maybe?
IIftah6/28/2023
I'll try to run without the breakpoint no, same thing when it runs without breakpoints I can use pdb and good old print() meanwhile, but I really prefer to use the IDE so I'll come back to it later
MMaartenBreddels6/28/2023
mario has it working now he'll share his settings
IIftah6/28/2023
ahhh sorry, my bad! now I see I have the same error when I run the script from the terminal. I've been blaming IntelliJ for no reason
Mmariobuikhuizen6/28/2023
Settings reference:
No description
MMaartenBreddels6/28/2023
ok, good to know do you think this should go in the docs?
IIftah6/28/2023
thanks Mario and Maarten I still don't know why I get the "A widget with mount-id="solara-main" should go here" but it has nothing to do with the debugger setup and the browser console showed me my error 🤦‍♂️ Regarding the adding to the docs - I think it can be helpful for beginners, but it's also simple enough to leave out of the docs... your call.
I am not a beginner myself but I was just stupid and unlucky to cause an error just as I was trying to set it up and blamed the wrong thing for the error
Mmariobuikhuizen6/28/2023
But, you still have the mount-id error when running from the cli?
MMaartenBreddels6/29/2023
https://github.com/widgetti/solara/pull/184 I've opened this PR, maybe you can take a look and possibly add a description to the section
MMaartenBreddels6/29/2023
it will save people quite some time i think. But maybe this sparse documetnation is already enough

Looking for more? Join the community!