Recently I updated my anaconda package, which installed
ipython 4.0.0
ipython-qtconsole 4.0.1
spyder 2.3.6
After that, whenever I restart the ipython kernel in the qt-console (using ctrl + .
), the console will not execute any command, e.g.:
Python 2.7.10 |Anaconda 2.3.0 (64-bit)| (default, May 28 2015, 16:44:52) [MSC v.1500 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.
IPython 4.0.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
%guiref -> A brief reference about the graphical user interface.
In [1]: 1
...:
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.
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:
platform : win-64
conda version : 3.18.1
conda-build version : 1.17.0
python version : 2.7.10
requests version : 2.7.0
This is an upstream bug. i.e. meaning a bug that needs to be fixed in Jupyter qtconsole
: https://github.com/jupyter/qtconsole
I'll try to submit a PR to qtconsole
after releasing 2.3.7.
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 Enter
(I don't know why! :-)
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 ipython qtconsole
from the shell.
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 kernel-foo.json
file.
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 :-)
I reproduce this easily on my systems using Jupyter QtConsole (installed via Canopy). Here is a screen shot. I notice it doesn't start right away, but usually I can get between 4 and 6 lines in before it hits. After it starts, there is a large delay to execute each line -- sometimes ten seconds after pressing shift-Enter before I get the answer.
Jupyter QtConsole 4.1.1
Python 2.7.10
IPython 4.0.1
So maybe this isn't just a spyder issue.
I have noticed this issue enter changing to shift-enter in spyder 2.3.8. I have also noticed that it takes two restarts for ipython console in spyder to accept commands
I have this issue and also have random issues with missing newlines in the input/output prompts: https://github.com/ContinuumIO/anaconda-issues/issues/661 It did not happen in Python(x, y), only after switching to Anaconda.
I have the same issue with WinPython 3.4.4.1. In specific, it is:
Windows 7 64 bit
Python 3.4.4 64 bit
Spyder 3.0.0 dev
IPython 4.1.1
Is there any way we can downgrade any of the packages (e.g IPython, Spyder) to address this issue temporarily until it's fixed? It's becoming somewhat annoying.
Thanks!
I understand your frustration and sorry for the annoyance.
Unfortunately, there's no workaround to avoid this problem, until we
really fix it.
El 01/04/16 a las 06:48, Agamemnon Krasoulis escribió:
Is there any way we can downgrade any of the packages (e.g IPython,
Spyder) to address this issue temporarily until it's fixed? It's
becoming somewhat annoying.Thanks!
—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub
https://github.com/spyder-ide/spyder/issues/2696#issuecomment-204362446
Just in case you are curious, this problem persists in 3.0 beta
I know, it'll only be fixed once we merge pull request #2878 (in 3.0 beta4)
@ccordoba12 This is because the new qtconsole uses FrontendWidget._is_complete()
request to determine whether the input is complete or not. The new mechanism uses the BaseFrontendMixin.blocking_client
for these requests. Since this is a new change, i guess spyder code does not yet reset the blocking_client
on kernel restart in addition to the kernel_client
attribute of the frontend widget
I'm getting the same situation as well for quit often. I'm using Pandas HDF modules. Whenever I'm loading large files and closing large files, it has a high probability that this will happen. Sometimes I waited for a while, it will come back. Please help me out. Thanks a lot!
@ccordoba12 It sounds like you know how to solve this issue - could you provide an estimate of when the update containing the fix is likely to be released?
We are planning to release Spyder 3.0 (which will contain this fix, among many other things) next month :-)
I updated to 3.0.0b2 and the issue still remains (using Ubuntu 64-bit)
sorry, I didn't see the comment that will be fixed in 3.0 beta4. In any case, using conda install
I couldn't find beta3 for linux 64-bit version; is it planned a release for linux 64-bit in beta4?
This problem will be fixed in Spyder 3.0rc1 (i.e. release candidate one), not in beta4. And yes, I'll publish Linux conda packages for beta4 and rc1 :-)
Thanks. I think someone else noticed this but if I open a new console the problem is gone; however, with 'restart kernel' the problem persist.
I have run into this issue today, waiting for the update with the fix.
Regards!
Just FYI, I ran into this issue for the first time today (07-sep-16) on a new installation of Anaconda on a work computer. Details:
Thanks for your efforts on this great piece of software.
Awesome Thank you Carlos just tested this in 3.0.0b6 and no issues.
@hal98x, I hope you meant in master ;-) This is going to be fixed in beta7 :-)
oh I just checked again and yes the problem still persists in beta6 guess the wow factor of version 3 got the best of me. So spyder 2.3.9 is fixed then?
No, no. This is going to be fixed in 3.0 beta7 (not released yet ;-)
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:
Spyder=3.1.2
Qt=5.7.1
PyQt5=5.7.1
ipykernel=4.5.2
ipython=5.2.1
qtconsole=4.2.1
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
Python 3.6.1
Qt 5.8
PyQt5 5.8.2
Python 5.3.0
on a Mac (Darwin).
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
Python 2.7.13
ipython 5.3.0
on Mac OSX 10.12
Also got that (probably since upgrade to spyder 3.0) and its severely annoying:
spyder 3.1.4
conda 4.3.21
Python 3.5.2 (64-bit)
ipython 6.1.0
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:
repr
(this is a problem introduced by IPython, not by us).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.
@Khris777, is the code you posted on issue #5052 causing this problem?
@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 head()
method on a dataframe with millions of rows and lots of columns.
@Khris777, a couple more questions:
@ccordoba12
Try this example, it reproduces the problem for me:
import pandas as pd
import numpy as np
nrow = 1000000
ncol = 50
test = np.ones((nrow,ncol),dtype=object)
df = pd.DataFrame(test)
Then enter commands like these into the console:
df.head()
df[df[1] == 1]
df[(df[1] == 1)&(df[4] == 1)]
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 dtype=object
is a significant factor here. Using the same array with dtype=int
makes it work well and to encounter some problematic behaviour (still way less than with dtype object) I need to set nrow = 10000000
. But since I'm working with arrays/dataframes that have mostly strings in them (internally dtype object), the example case is fitting.
@Khris777, thanks a lot for the reproducible example, this is exactly what we need!
Since the cause of your problem is different from the one reported here, I opened issue #5280 to continue the discussion there.
The problem is with the default editor for *.py files.
I had set it to Notepad++; so each time I execute the *.py file, it opens the instance of file in Notepad++ and returns a new Line.
Change the default editor for *.py file to default Python Application and it solves the problem.
Hope it helps.
:)
The problem still exists. Even now I am having the problem.
I press enter and instead of executing the command it give a new line in spyder.
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
Python 3.7.0
IPython 7.5.0
conda 4.6.14
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
Python 3.6.10 |Anaconda, Inc.| (default, May 7 2020, 19:46:08) [MSC v.1916 64 bit (AMD64)]
win10
IPython 7.13.0 -- An enhanced Interactive Python.
Copy the code from elsewhere and paste it into the Ipython Console to run it.
Sometimes the line continuation character is automatically added after pressing the Enter key, and sometimes it is run after pressing the Enter key.
In order to run, the adopted scheme isshift + enter
.
Most helpful comment
if you hold down shift and press enter it works fine (although not what we want)