You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I also wrote this in the PyVista repo but thought I'd try my luck here instead.
Sample Code What is the problem, question, or error?
Write a short description telling me what you are doing, what you expect to happen, and what is currently happening.
# file: test.pyimportpyvistaaspvimportipywidgetsaswgfrompyvistaimportexamplespv.global_theme.trame.jupyter_extension_enabled=FalseclassTest():
def__init__(self):
self.output=wg.Output()
self.button=wg.Button(description="Show")
self.button.on_click(self.button_click)
self.combined=wg.VBox([self.output, self.button])
# pv.start_xvfb() # Run this only in Dockerpv.set_jupyter_backend('server')
defbutton_click(self, event):
self.show()
defshow(self):
withself.output:
self.output.clear_output(wait=True)
mesh=examples.download_nefertiti()
mesh.rotate_x(-90.0, inplace=True)
p=pv.Plotter(notebook=True)
p.add_mesh(mesh, color="linen", pbr=True, metallic=0.8, roughness=0.1, diffuse=1)
p.show()
defwidget(self):
returnself.combinedtest=Test()
page=test.widget()
Description
I’m new to both PyVista and Solara and am working on creating a Solara app that incorporates ipywidgets and a PyVista plot. Everything functions correctly when I run it locally on my Windows PC solara run test.py. When I click the Show button-widget, the PyVista plot renders in the output-widget.
However, I’m having trouble getting this to work in my Docker container (it does work as a solo widget within Jupyter Lab of the container though). I'm encountering an error (see below). Can anyone advise on how to resolve this issue? I provided a sample code.
System Information
ERROR:root:Exception raised by task = <Task finished name='Task-2' coro=<WebAppServer.start() done, defined at /opt/conda/lib/python3.10/site-packages/wslink/backends/aiohttp/__init__.py:117> exception=RuntimeError('set_wakeup_fd only works in main thread of the main interpreter')>
Traceback (most recent call last):
File "/opt/conda/lib/python3.10/asyncio/unix_events.py", line 105, in add_signal_handler
signal.set_wakeup_fd(self._csock.fileno())
ValueError: set_wakeup_fd only works in main thread of the main interpreter
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/conda/lib/python3.10/site-packages/trame_server/core.py", line 710, in on_done
task.result()
File "/opt/conda/lib/python3.10/asyncio/futures.py", line 201, in result
raise self._exception.with_traceback(self._exception_tb)
File "/opt/conda/lib/python3.10/asyncio/tasks.py", line 232, in __step
result = coro.send(None)
File "/opt/conda/lib/python3.10/site-packages/wslink/backends/aiohttp/__init__.py", line 123, in start
await self._runner.setup()
File "/opt/conda/lib/python3.10/site-packages/aiohttp/web_runner.py", line 281, in setup
loop.add_signal_handler(signal.SIGINT, _raise_graceful_exit)
File "/opt/conda/lib/python3.10/asyncio/unix_events.py", line 107, in add_signal_handler
raise RuntimeError(str(exc))
RuntimeError: set_wakeup_fd only works in main thread of the main interpreter
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I also wrote this in the PyVista repo but thought I'd try my luck here instead.
Sample Code What is the problem, question, or error?
Write a short description telling me what you are doing, what you expect to happen, and what is currently happening.
Description
I’m new to both PyVista and Solara and am working on creating a Solara app that incorporates ipywidgets and a PyVista plot. Everything functions correctly when I run it locally on my Windows PC solara run test.py. When I click the Show button-widget, the PyVista plot renders in the output-widget.
However, I’m having trouble getting this to work in my Docker container (it does work as a solo widget within Jupyter Lab of the container though). I'm encountering an error (see below). Can anyone advise on how to resolve this issue? I provided a sample code.
System Information
Beta Was this translation helpful? Give feedback.
All reactions