-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Vaex process stuck in the Spyder IPython console (only) #16183
Comments
Hi @erwanp, Can you upgrade your Spyder to 5.1.1 and try it again? I'm in the latest version and I'm not able to reproduce this issue. |
Same problem with I also confirm that the process is stuck if using Qt5 graphics in iPython console; and not stuck if using Inline graphics (although no graphic is shown in the minimal code) |
Which version of Vaex are you using? I'm activating the option for using Qt5 graphics and the minimal example is still running on my end. This is my output for the Vaex version I installed:
|
We have the same version
|
I could reproduce this issue on Windows, we will investigate it because it doesn't happen on macOS or Linux. We will try to fix it for one of our next releases. @impact27, when the console stays opened some errors start appearing,
I don't know if this is related to the kernel. |
Well done for reproducing it. The 2 other users also experienced it on Windows. If it can help , note that I also reproduce the issue on the Ubuntu I host on my Windows VMWare. |
I wonder if this could be because Vaex is using nest_asyncio, is spyder using an event loop? |
Hey @maartenbreddels, thanks for showing up! That's a very good point: when people activate the Qt5 Matplotlib backend, a Qt event loop is created in the console to handle interactive figures created by it. That's not done by Spyder, but by IPython (we just run @erwanp, could you try running in a notebook
then creating a Vaex dataframe to see what happens there? My guess is that you should observe the same stuck behavior. |
looks like the handler is not an asyncio coroutine. I think the error was introduced in spyder-ide/spyder-kernels#292. Maybe we need to replace https://github.com/spyder-ide/spyder-kernels/blob/db5aebe79e8820623926df9c480b893c9692a815/spyder_kernels/comms/frontendcomm.py#L155 by |
Indeed @ccordoba12 , I am stuck there too |
@maartenbreddels, since this is not a problem with Spyder, do you think it can be fixed in Vaex somehow? |
@impact27, could you help me to fix that in spyder-kernels? Thanks! |
That's gonna be difficult to fix I'm afraid. I think the problem is the interaction between nest_asyncio and pyqt, does erdewit/nest_asyncio#8 maybe help? |
vaexio/vaex#1546 might fix this, but I cannot use that solution as explained in the issue |
That looks really promising! But it'd need to added to ipykernel so all projects benefit from it.
Ok, then I think the best solution is to make the Qt and asyncio loops work together. |
Hello @impact27 . Did you have the chance to look at the problem above ? |
If you install the latest alpha, you can try this trick vaexio/vaex#1546 (comment) to see if it does not get stuck (that might tell you that nest_asyncio is the problem). |
We could set the @maartenbreddels, I guess that can't be done on demand, right? I mean, to only set that env var when people activate an interactive Matplotlib backend? |
That's great news. I'm actually going to test if I can make that the default, and only set it to 'nest' when we need it (when using the jupyter widgets). |
Great news @maartenbreddels! Please keep us posted about it. |
A bigger challenge then I hoped for, and I'm pretty sure in not all case the 'awaitio' method will work currently. In any case, |
As far as Radis is concerned, I understand that we can :
The 2nd option would allow us to start using Vaex as our by-default DataFrame library (almost) immediatly |
It's released in the latest alpha for sure, but I think there are edgecases that might not work (some groupby operation, that might not work without the nested asyncio). |
vaexio/vaex#1783 should fix this, it's not released yet, but confirmation would be great (vaex v4.8 should be the next release) |
Tested right now ; everything works properly with Vaex 4.8 Vaex 4.8 is officially released so we can consider this issue fixed. Thank you @maartenbreddels @ccordoba12 |
Well, I think @maartenbreddels is the one that deserves all the credit here. Thanks for making Spyder a fully supported platform for Vaex! |
Issue Report Checklist
conda update spyder
(orpip
, if not using Anaconda)jupyter qtconsole
(if console-related)spyder --reset
(fixed the problem with inline graphics, see below)Problem Description
Spyder IPython console process becomes stuck when computing a mean with vaex.
Does not happen with other IDEs / Consoles.
Somehow, it may be related to the output graphics mode of the Spyder iPython console (see below)
What steps reproduce the problem?
Minimal error :
Script works well if
As pointed out by @minouHub , opening a new Spyder IPython console unlocks the process. If console has been "unlocked", I can even re-run the script another time before it gets stuck again. (?)
Last thing : although no graphics are plot anywhere in this example, this problem appears when my iPython console has Qt5 output graphics. It does not appear with Inline graphics (tried both consistently 3 times)
Versions
on Windows.
Spyder installed through Anaconda
The text was updated successfully, but these errors were encountered: