spyder: Vaex process stuck in the Spyder IPython console (only)
Issue Report Checklist
- Searched the issues page for similar reports
- Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
- Reproduced the issue after updating with
conda update spyder(orpip, if not using Anaconda) - Could not reproduce inside
jupyter qtconsole(if console-related) - Tried basic troubleshooting (if a bug/error)
- Restarted Spyder
- Reset preferences with
spyder --reset(fixed the problem with inline graphics, see below) - Reinstalled the latest version of Anaconda
- Tried the other applicable steps from the Troubleshooting Guide
- Completed the Problem Description, Steps to Reproduce and Version sections 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 :
import numpy as np
import vaex
df = vaex.from_dict({"E":np.random.rand(1000)})
print(df)
print("before EQ mean")
E_bins = df.mean("E", binby="E", shape=10)
print("after EQ mean") # š I never get to here
Script works well if
- ran from an Ipython ( 7.22.0) console in the terminal
- ran from Python in the terminal
- ran from VS Code
- ran from Jupyter Lab (3.0.14)
- ran in Jupyter QtConsole
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
spyder
spyder-kernels 2.0.5 py38haa95532_0 ipython 7.22.0 py38hd4e2768_0
on Windows.
Spyder installed through Anaconda
- Spyder version: 5.0.5 py38haa95532_2
- Python version: 3.8.8
- Qt version: 5.9.7 vc14h73c81de_0
- PyQt version: 1.9.0
- Operating System name/version: Windows 10
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 29 (13 by maintainers)
Commits related to this issue
- add warning if using Spyder and Vaex see https://github.com/spyder-ide/spyder/issues/16183 — committed to erwanp/radis by erwanp 3 years ago
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
If you install the latest alpha, you can try this trick https://github.com/vaexio/vaex/pull/1546#issuecomment-935535045 to see if it does not get stuck (that might tell you that nest_asyncio is the problem).
Well, I think @maartenbreddels is the one that deserves all the credit here. Thanks for making Spyder a fully supported platform for Vaex!
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).
@ccordoba12 https://github.com/spyder-ide/spyder-kernels/pull/317
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
%matplotlib qt5behind the scenes).@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.
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.
Same problem with
Spyder 5.1.1andPython 3.8.8 64-bit | Qt 5.12.10 | PyQt5 5.12.3 | Windows 10I 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)
Same symptoms for other users : @MinouHub; @BlehMaks
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.