-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import rosys does not work with ui.run(reload=False) - RuntimeError: multiprocessing start method must be "spawn" #19
Comments
Thanks for reporting this @AndyPermaRobotics, but the example works fine here on MacOS. Are you testing this on Windows? About the multiple evaluation of main you may want to have a look into the NiceGUI FAQ where I just added the infos from zauberzeug/nicegui#794. In RoSys we often use the last option with |
@rodja thanks for the link to the FAQ, my script works now. It's interesting, that you could not reproduce the issue on MacOS. Dockerfile:
docker-compose.yml version: "3.9"
services:
rosys_service:
build: .
tty: true
ports:
- "8080:8080"
volumes:
- ./:/app
hostname: docker |
Ah very good @AndyPermaRobotics. With Docker the error comes up as described by you. Before I had just tested locally on mac. |
@rodja Do you already have an idea what to do about it? |
No, I have not looked into it. |
I looked into this a little. I think the best way to solve this may be keeping Nicegui's behavior consistent in case there is no specific reason that it does not set the spawn method when Another Option would be forcing the method to spawn instead of raising an exception in rosys.py |
Hello everyone,
I have come across the following error message when I set the reload flag to False in the ui.run function:
To better localize the source of the error, I have created a minimal example where the error occurs. Just
import rosys
is enough.Example:
The error also occurs when I try to plan a path in my main program.
How did I come up with the idea of setting reload=False?
The reload flag causes my script to run twice. This results in two instances of each class being created. This has caused problems when I tried to subscribe to an MQTT topic, and my callback function was suddenly called twice for each message. The reload does not seem to be a complete restart where all resources from the previous run are cleaned up.
The text was updated successfully, but these errors were encountered: