S
Solara2y ago
Iftah

I m using IntelliJ

I'm using IntelliJ
19 Replies
MaartenBreddels
you can probably add a python debugger from the ide, so you have to configure intellj how to start up solara
mariobuikhuizen
@MaartenBreddels do you have an example how to start solara from a .py file? You can select debug on a .py file from intellij
MaartenBreddels
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)
mariobuikhuizen
It specifically needs the script file, I haven't found another way yet.
MaartenBreddels
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...
MaartenBreddels
python -m solara run <script> also works
MaartenBreddels
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...
mariobuikhuizen
I think <script> will be filled in by intellij
Iftah
IftahOP2y ago
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
mariobuikhuizen
The widget is not send to the frontend because the debugger is pauzed maybe?
Iftah
IftahOP2y ago
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
MaartenBreddels
mario has it working now he'll share his settings
Iftah
IftahOP2y ago
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
mariobuikhuizen
Settings reference:
No description
MaartenBreddels
ok, good to know do you think this should go in the docs?
Iftah
IftahOP2y ago
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
mariobuikhuizen
But, you still have the mount-id error when running from the cli?
MaartenBreddels
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
MaartenBreddels
it will save people quite some time i think. But maybe this sparse documetnation is already enough
Want results from more Discord servers?
Add your server