-
-
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
Enter in the IPython console inserts new line instead of executing current line after kernel restart #2696
Comments
Same behavior here (Python 3.4.3, Anaconda 2.3, Ubuntu 14.04) |
I'm getting the same behavior on Windows 10 x64, Python 3. |
Thanks for reporting. I'll try to fix it for 2.3.7 |
I can reproduce this error both in Python 2 and Python 3. No idea where it's coming from though :-) |
Same problem with Spyder 2.3.6, PyQt4 4.10.4:
conda-build version : 1.17.0 |
This is an upstream bug. i.e. meaning a bug that needs to be fixed in Jupyter I'll try to submit a PR to |
if you hold down shift and press enter it works fine (although not what we want) |
Anyone happen to know which qtconsole issue # is the cause of this? |
I think this issue only happens in Spyder, so that's why it shouldn't be reported upstream. The thing is we handle restarts differently than qtconsole, and that seems to have an impact on |
The Enthought Canopy UI ipython console window doesn't have the issue - wonder if it is worth peeking into their source.. |
Yep, that's because (as said above) we handle kernel restarts differently from qtconsole (Canopy uses qtconsole almost unmodified as far as I know :-) |
I don't know how Canopy uses qtconsole, but their UI looks similar to Spyder, in that it has a movable/re-dockable panel with a variable explorer (and a more integrated debugger) etc. It certainly doesn't look anything like the minimal window that you see when just starting Given that from the end-user perspective, the way the ipython console appears in both Spyder and Canopy is almost identical, perhaps it would be worth looking into how Canopy achieved their integration in case it reveals any hints as to avoiding this enter<->shift-enter behavior reversal (or maybe not..). Just a thought (in absence of knowledge of either implementation). |
The thing is we start our kernels through our Python console and later connect to them in our IPython console using its That's necessary to connect IPython kernels to our Variable Explorer, but we plan to remove this workaround in Spyder 3.0 and connect to them directly. That will also remove this bug :-) |
Python 2.7.12, Spyder 3.1, Windows 7 64bits, conda 4.3.7 I just received the same error - in the middle of executing it stopped working. Restart of kernel didn't help. I found the cause. If I restart the console and do not execute this; np.set_printoptions(linewidth=100, precision=4,suppress=True,threshold='nan') it does work. But once I modify the print options for numpy arrays, the IPython console will not execute. I believe that the treshold='nan' is causing the problem. |
Any update on this? I still see it with the following:
|
I was having this exactly problem (the issue's question), so I tried "Shift+Enter" in IPython console and it worked for me. |
I "shift+enter" and it froze. Everytime, I have to restart a new console. |
I ran into the same problem. I am using spyder 3.1.3 I found that the graphics backend determined whether I had the problem. When I used either the Qt5 or OS X backend I would have the problem. Plus it would toggle back and forth between giving me the problem or not every time I plotted a graph. When I used either the Tkinter or Inline backends, I didn't have the problem. I did not test either the Automatic or Qt4 backends. |
Same here, with: conda 4.3.17 on Mac OSX 10.12 |
Also got that (probably since upgrade to spyder 3.0) and its severely annoying: spyder 3.1.4 on Linux Mint 18 |
This has happened many times to me today while working with pandas in Spyder 3.2 on Python 3.6/Win10. For me it was always after viewing a DataFrame with the head() method. CPU usage bumped up to 20ish% and Python's memory usage started steadily creeping up until I restarted the IPython kernel. I had to switch to a command prompt window because the embedded console in Spyder became essentially unusable. |
I have been encountering this as well recently after some of the latest upgrades. Using Python 3.6.2 on Windows 10, IPython 6.1.0, and Spyder 3.6, I encounter the same behaviour using pandas and large dataframes. The console stays responsive when using the head() method, but the result eventually appears after hitting enter a few times and waiting. It's not limited to the head() method though. In other cases I have to put a line of code into an open file and hit F9 to get it to execute. This only seems to happen with very large data (right now having 11.6 million lines with 24 columns in memory). I didn't encounter this before when working with Python 2 and IPython 5. |
There are two reasons for this to happen:
We'll try to fix both issues in 3.2.2. |
I have the same issue and for me the following fixed on my mac,
|
I'm now on Spyder 3.2.3 and I still experience this issue. |
@ccordoba12 , that code does not cause the problem anymore, that part has been fixed. I'm still getting the problem however with large pandas dataframes, e.g. when using the |
@Khris777, a couple more questions:
|
Try this example, it reproduces the problem for me:
Then enter commands like these into the console:
You should pretty soon encounter a case when pressing enter will bring up another line and seemingly not executing the command. The behaviour is erratic though, sometimes a command works, then it won't. Adding the commands into a file and pressing F9 for that line always works, and sometimes after doing so entering a command manually will work again as well. EDIT: It seems like |
The problem is with the default editor for *.py files. |
The problem still exists. Even now I am having the problem. |
Just posting to say I am currently having this issue as well. |
@Mastiff37 it was visible in ipython 7.0. I updated the ipython with conda to 7.5. this issue is gone. |
Having this issue as well on macOS Mojave Version 10.14.6 Beta (18G48F) Spyder 3.3.4 |
You need to use the Inline graphics backend instead of the Automatic one to fix this problem. |
That's not a fix if we want to use the Automatic backend... |
You can use the Tkinter backend instead. |
Spyder 3.3.6 on MacOS seems to be completely broken. ENTER does not work. Opening bracket does not work. Very erratic: Often, it works after a kernel restart. But only for a few commands, then it's broken again. |
Like here, with:Restart kernel for IPython console changes Enter behavior · Issue #2711 · spyder-ide/spyder Spyder 4.1.3 Copy the code from elsewhere and paste it into the Ipython Console to run it. |
Recently I updated my anaconda package, which installed
After that, whenever I restart the ipython kernel in the qt-console (using
ctrl + .
), the console will not execute any command, e.g.:I cannot reproduce this behavior when running ipython-qtconsole outside spyder, i.e. it works as expected. My current workaround ist closing the console, thus killing the kernel, and load a fresh one.
The text was updated successfully, but these errors were encountered: