Closed mg3146 closed 1 year ago
Here is a reproducible example.
import pandas as pd
data = range(5)
index = range(3)
cols = range(4)
df = pd.DataFrame(data = data, columns = cols, index = index)
If there was a way to fix this one for the next release, I would really appreciate it. As its killing my productivity (I still seem to have issues with 5), and I love using Spyder
Hey @mg3146, thanks for reporting. Are you getting these errors when using Spyder 5?
I can't even get Spyder 5 to launch anymore, so I've just been using 6. This wasn't a problem for me in Spyder 5 though when I was using it. Are you not able to reproduce?
Not on Linux. @dalthviz, can you reproduce this problem on Windows?
maybe its something to do with this corrupted environment of mine that's causing issues with both this and Spyder 5. If it helps, when I try to launch Spyder 5 from the anaconda powershell prompt I get the following traceback before it crashes:
If you have Spyder 5 and 6 in the same env, I think that should be the cause. Please create a new env for Spyder 6 and report back if you're still having this problem.
Took a look into that. Spyder 6 I used your standalone installer. For the console, I had originally been using an environment that Spyder 5 installed in it (via conda install spyder). I created a new environment without Spyder 5 installed, and I'm still getting the same crash / bug.
Here is a conda list of the environment I'm using for the console.
No worries, I tested on Windows and I was able to reproduce this problem with the code you provided above. We'll try to fix it for alpha2.
@impact27, this is a very serious bug and it doesn't happen on 5.x, which means it should be related to the many changes you did to the way we handle kernels.
Could you take a look at it? Thanks!
This is a tricky one. For some reason inspecting a frame while a pandas object is being created crashes python. This also means that debugging this would crash python. The problem here is that when a traceback is created in Spyder 6, the frames are inspected to provide helpful information about the crash. We could remove this but the underlying issue, which is probably a pandas issue, would still be there.
Can you check if https://github.com/spyder-ide/spyder-kernels/pull/464 fixes this issue?
To reproduce, from a terminal:
% ipython
Python 3.10.8 (main, Oct 13 2022, 09:48:40) [Clang 14.0.0 (clang-1400.0.29.102)]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.14.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import pandas as pd
In [2]: data = range(5)
...: index = range(3)
...: cols = range(4)
In [3]: %debug pd.DataFrame(data = data, columns = cols, index = index)
NOTE: Enter 'c' at the ipdb> prompt to continue execution.
> <string>(1)<module>()
ipdb> s
--Call--
> /opt/homebrew/lib/python3.10/site-packages/pandas/core/frame.py(608)__init__()
606 # Constructors
607
--> 608 def __init__(
609 self,
610 data=None,
ipdb> self.anythingatall
*** RecursionError: maximum recursion depth exceeded while calling a Python object
ipdb>
On macOS, I get a "RecursionError", on windows, python crashes.
Should I open a bug in pandas? It is not clear this is really an issue unless you are debugging, in which case you are interfering with the program flow. I think we should probably not get the traceback locals as this might get triggered.
Should I open a bug in pandas?
Yeah, please do.
It is not clear this is really an issue unless you are debugging, in which case you are interfering with the program flow. I think we should probably not get the traceback locals as this might get triggered.
I saw that you already did that, but I agree.
Hi - quick bug. It seems like when you get a pandas error, like this one, it kills the Spyder iPython console: