Spyder: Enter inserts new line instead of executing the command

Created on 1 Feb 2018  路  26Comments  路  Source: spyder-ide/spyder

Hi,
I have been confronted to this issue for the last few days after updating anaconda. After some time using Spyder the console would not behave as expected: pressing enter creates a new line instead of executing the command. Pressing shift+enter executes it but extremely slowly ( "2+2" takes ten seconds)

I cannot reproduce this behaviour on demand. It happens after some time, first I had the impression that large dataset and pasting in the console were likely triggers, but it also happens when I am not in this case...

I tried to downgrade spyder, qt, ... with no effect. This morning I uninstalled anaconda and installed it back again, and the bug persists.

This is my first message here, so sorry if I am not being clear.
Thanks a lot for your help
Pierre

Versions and main components

  • Spyder Version: 3.2.6
  • Python Version: 3.6.3
  • Qt Version: 5.6.2
  • PyQt Version: 5.6.0
  • Operating system: HighSierra 10.13.3 on macbook air 2012

Dependencies

IPython >=4.0 : 6.2.1 (OK)
cython >=0.21 : None (NOK)
jedi >=0.9.0 : 0.11.1 (OK)
nbconvert >=4.0 : 5.3.1 (OK)
numpy >=1.7 : 1.14.0 (OK)
pandas >=0.13.1 : 0.22.0 (OK)
psutil >=0.3 : 5.4.3 (OK)
pycodestyle >=2.3: 2.3.1 (OK)
pyflakes >=0.6.0 : 1.6.0 (OK)
pygments >=2.0 : 2.2.0 (OK)
pylint >=0.25 : 1.8.2 (OK)
qtconsole >=4.2.0: 4.3.1 (OK)
rope >=0.9.4 : 0.10.7 (OK)
sphinx >=0.6.6 : 1.6.6 (OK)
sympy >=0.7.3 : None (NOK)

IPython Console Bug

Most helpful comment

I noticed that whenever I am working with a large dataframe, I need to shift+Enter to execute the statement

All 26 comments

Thanks for reporting @s2raf. I also noticed this problem but I don't know where it comes from. We'll try to fix to it in a future release.

As another data point, occasionally, I've noticed enter inserting a line break rather than executing the statement (but with no real temporal pattern or particular functions that I noticed), and separately there are a few specific functions that would make the console hang on open/close parens (due to introspection encountering some huge data structure), but while I've had Spyder open for many days at a time with on and off use throughout, I don't think I've noticed both happening together as you describe, at least on Windows.

I noticed that whenever I am working with a large dataframe, I need to shift+Enter to execute the statement

@Prikers, did you disable tooltips in our consoles?

@ccordoba12, nope, forgot about that. I will try that next time I have a large dataframe to work with (this was only for ~20Gb dataframes)

Apparently my "problem" is gone. It disappeared after reseting Spyder, which I did not do before opening this issue, even though I reinstalled anaconda.

After executing "spyder --reset", everything seems to work OK, I've not bumped into that bug for the last 4 days.

Pierre

Good to know! However, I'm still able to reproduce it.

It's back. And Spyder crashed while trying to open a new console.
Today I installed and used new packages and ther dependencies (pillow, scikit-image). It occurred when I switched from inline to macOSX backends, but have no idea if it is related...

Recently observed this exact behavior. Spyder 3.2.7 Python 3.6.3. Appeared only for large dataframes. Calling the data frame in the console to print it would often work, but calling df.head() would start a newline and give ...: as if I had forgotten a parenthesis. With smaller dataframes this behavior would occur inconsistently. A command might cause it but the same command 30 seconds later would not.

@jmdata86, to avoid this problem please go to

Preferences > IPython console > Display

and deactivate the option called

Display balloon tips

The problem is the kernel gets stuck getting calltips for large dataframes, and that's what causes the new line problem.

Hello,

I also have their problem, even when I am not working with large dataframes.
It even happens when I check the length of an (small) array.

@morsanimi And what happened when you tried the workaround posted immediately above your comment?

It happens less often.

Hi,
the issue is back (even with ballon tips deactivated). The issue appears after the 2nd or third command ("import ..." or "2+2"). It is not related to large dataframes as I do not even have time to load anything.
Python 3.6.6
IPython 7.0.1
Spyder 3.3.1

Thanks for your help,
Pierre

@s2raf Sorry its come back. Can you paste your dependency output again? Was anything changed, added or updated before it stopped working? I tried it with Win 8.1 x64, Spyder 3.3.1, Python 3.6.6, Qt/PyQt 5.9.2/6, and IPython 7.0.1 even with 5-6 lines multiple times, and have never seen the problem.

I've seen this myself and I think this is an issue with the latest IPython and/or ipykernel. Please try to downgrade to IPython 6.5.0 and ipykernel 4.8.2 and try again.

Hmm. I tested on ipython 6.5.0 + ipykernel 4.8.2, as well as on ipython 7.0.1 + ipykernel 5.1.0 (in an environment just updated with conda update --all) on Python 3.6.6 and 3.6.7, and was unable to reproduce the problem even after a dozen varied commands each and doing dataframe-related stuff.

Happening to me, very regularly, every session. Tried the "Automatic" backend, and disabling balloon tips. Still there.

macOS 10.14.2
Anaconda (relatively new install -- 1 week ago)
Spyder 3.3.2
Python 3.7.1
IPython 7.2.0

@chafer31415 This might be related to #2902 . Can you try conda install ipykernel=4?

Ok, yes. _Much_ better after conda install ipykernel=4. I was about to write "totally" fixed, but then it did happen once, though gently -- meaning the kernel came back after one extra ... line, rather than many extra lines. Still, though, much good was done with this fix, so my problem is clearly related to #2902. Thanks for the help!

@chafer31415, you also need to update qtconsole (with conda update qtconsole) to avoid the extra ... that appears sometimes.

Yes, I executed conda update qtconsole and that seems to have cured the problem entirely. Thank you so much for your advice.

Closing because this was fixed in Qtconsole version 4.4.3.

I'm also having this problem, on Spyder 3.3.3, Python 3.7. I've had this issue with multiple releases of Spyder on two different machines going back months now, I usually just get frustrated and give up. I now have no alternative to Python however, and really need this issue fixed as doing any actual work has become next to impossible.

I've tried all of the above (resetting Spyder, updating ipykernel, updating qtconsole, disabled 'display balloon tips' in Preferences) but nothing seems to work. Has a fix to this problem been found?

See issue #2902.

I have the same issue not related to MacOS, My SSOO is windows 10.
attached info about my environment

conda info

 active environment : None
   user config file : ....\.condarc

populated config files : .....condarc
conda version : 4.7.10
conda-build version : 3.18.9
python version : 3.7.3.final.0
virtual packages : __cuda=9.2
base environment : ....\Anaconda3 (writable)
channel URLs : https://repo.anaconda.com/pkgs/main/win-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/win-64
https://repo.anaconda.com/pkgs/r/noarch
https://repo.anaconda.com/pkgs/msys2/win-64
https://repo.anaconda.com/pkgs/msys2/noarch
package cache : ....Anaconda3\pkgs
.....conda\pkgs
....\AppData\Local\conda\conda\pkgs
envs directories : ....\Anaconda3\envs
.....conda\envs
....\AppData\Local\conda\conda\envs
platform : win-64
user-agent : conda/4.7.10 requests/2.22.0 CPython/3.7.3 Windows/10 Windows/10.0.17763
administrator : False
netrc file : None
offline mode : False


conda list

packages in environment at .....\Anaconda3:

#

Name Version Build Channel

_ipyw_jlab_nb_ext_conf 0.1.0 py37_0
alabaster 0.7.12 py37_0
anaconda-client 1.7.2 py37_0
anaconda-navigator 1.9.7 py37_0
asn1crypto 0.24.0 py37_0
astroid 2.2.5 py37_0
attrs 19.1.0 py37_1
babel 2.7.0 py_0
backcall 0.1.0 py37_0
beautifulsoup4 4.7.1 py37_1
bleach 3.1.0 py37_0
bzip2 1.0.8 he774522_0
ca-certificates 2019.5.15 0
certifi 2019.6.16 py37_0
cffi 1.12.3 py37h7a1dbc1_0
chardet 3.0.4 py37_1
click 7.0 py37_0
cloudpickle 1.2.1 py_0
clyent 1.2.2 py37_1
colorama 0.4.1 py37_0
conda 4.7.10 py37_0
conda-build 3.18.9 py37_0
conda-env 2.6.0 1
conda-package-handling 1.3.11 py37_0
conda-verify 3.1.1 py37_0
console_shortcut 0.1.1 3
cryptography 2.7 py37h7a1dbc1_0
decorator 4.4.0 py37_1
defusedxml 0.6.0 py_0
docutils 0.14 py37_0
entrypoints 0.3 py37_0
filelock 3.0.12 py_0
freetype 2.9.1 ha9979f8_1
future 0.17.1 py37_0
glob2 0.7 py_0
icu 58.2 ha66f8fd_1
idna 2.8 py37_0
imagesize 1.1.0 py37_0
ipykernel 4.10.0 py37_0
ipython 7.6.1 py37h39e3cac_0
ipython_genutils 0.2.0 py37_0
ipywidgets 7.5.0 py_0
isort 4.3.21 py37_0
jedi 0.13.3 py37_0
jinja2 2.10.1 py37_0
jpeg 9b hb83a4c4_2
json5 0.8.4 py_0
jsonschema 3.0.1 py37_0
jupyter_client 5.3.1 py_0
jupyter_core 4.5.0 py_0
jupyterlab 1.0.2 py37hf63ae98_0
jupyterlab_server 1.0.0 py_0
keyring 18.0.0 py37_0
lazy-object-proxy 1.4.1 py37he774522_0
libarchive 3.3.3 h0643e63_5
libiconv 1.15 h1df5818_7
liblief 0.9.0 ha925a31_2
libpng 1.6.37 h2a8f88b_0
libsodium 1.0.16 h9d3ae62_0
libtiff 4.0.10 hb898794_2
libxml2 2.9.9 h464c3ec_0
lz4-c 1.8.1.2 h2fa13f4_0
lzo 2.10 h6df0209_2
m2w64-gcc-libgfortran 5.3.0 6
m2w64-gcc-libs 5.3.0 7
m2w64-gcc-libs-core 5.3.0 7
m2w64-gmp 6.1.0 2
m2w64-libwinpthread-git 5.0.0.4634.697f757 2
markupsafe 1.1.1 py37he774522_0
mccabe 0.6.1 py37_1
menuinst 1.4.16 py37he774522_0
mistune 0.8.4 py37he774522_0
msys2-conda-epoch 20160418 1
navigator-updater 0.2.1 py37_0
nbconvert 5.5.0 py_0
nbformat 4.4.0 py37_0
notebook 6.0.0 py37_0
numpydoc 0.9.1 py_0
olefile 0.46 py37_0
openssl 1.1.1c he774522_1
packaging 19.0 py37_0
pandoc 2.2.3.2 0
pandocfilters 1.4.2 py37_1
parso 0.5.0 py_0
pickleshare 0.7.5 py37_0
pillow 6.1.0 py37hdc69c19_0
pip 19.1.1 py37_0
pkginfo 1.5.0.1 py37_0
powershell_shortcut 0.0.1 2
prometheus_client 0.7.1 py_0
prompt_toolkit 2.0.9 py37_0
psutil 5.6.3 py37he774522_0
py-lief 0.9.0 py37ha925a31_2
pycodestyle 2.5.0 py37_0
pycosat 0.6.3 py37hfa6e2cd_0
pycparser 2.19 py37_0
pyflakes 2.1.1 py37_0
pygments 2.4.2 py_0
pylint 2.3.1 py37_0
pyopenssl 19.0.0 py37_0
pyparsing 2.4.0 py_0
pyqt 5.9.2 py37h6538335_2
pyrsistent 0.14.11 py37he774522_0
pysocks 1.7.0 py37_0
python 3.7.3 h8c8aaf0_0
python-dateutil 2.8.0 py37_0
python-libarchive-c 2.8 py37_11
pytz 2019.1 py_0
pywin32 223 py37hfa6e2cd_1
pywinpty 0.5.5 py37_1000
pyyaml 5.1.1 py37he774522_0
pyzmq 18.0.0 py37ha925a31_0
qt 5.9.7 vc14h73c81de_0
qtawesome 0.5.7 py37_1
qtconsole 4.5.2 py_0
qtpy 1.8.0 py_0
requests 2.22.0 py37_0
rope 0.14.0 py_0
ruamel_yaml 0.15.46 py37hfa6e2cd_0
send2trash 1.5.0 py37_0
setuptools 41.0.1 py37_0
sip 4.19.8 py37h6538335_0
six 1.12.0 py37_0
snowballstemmer 1.9.0 py_0
soupsieve 1.8 py37_0
sphinx 2.1.2 py_0
sphinxcontrib-applehelp 1.0.1 py_0
sphinxcontrib-devhelp 1.0.1 py_0
sphinxcontrib-htmlhelp 1.0.2 py_0
sphinxcontrib-jsmath 1.0.1 py_0
sphinxcontrib-qthelp 1.0.2 py_0
sphinxcontrib-serializinghtml 1.1.3 py_0
spyder 3.3.6 py37_0
spyder-kernels 0.5.1 py37_0
sqlite 3.29.0 he774522_0
terminado 0.8.2 py37_0
testpath 0.4.2 py37_0
tk 8.6.8 hfa6e2cd_0
tornado 6.0.3 py37he774522_0
tqdm 4.32.1 py_0
traitlets 4.3.2 py37_0
urllib3 1.24.2 py37_0
vc 14.1 h0510ff6_4
vs2015_runtime 14.15.26706 h3a45250_4
wcwidth 0.1.7 py37_0
webencodings 0.5.1 py37_1
wheel 0.33.4 py37_0
widgetsnbextension 3.5.0 py37_0
win_inet_pton 1.1.0 py37_0
wincertstore 0.2 py37_0
winpty 0.4.3 4
wrapt 1.11.2 py37he774522_0
xz 5.2.4 h2fa13f4_4
yaml 0.1.7 hc54c509_2
zeromq 4.3.1 h33f27b4_3
zlib 1.2.11 h62dcd97_3
zstd 1.3.7 h508b16e_0

Was this page helpful?
0 / 5 - 0 ratings