Skip to content
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

Prompt appearing twice in the ipython console #5521

Closed
callegar opened this issue Oct 20, 2017 · 9 comments
Closed

Prompt appearing twice in the ipython console #5521

callegar opened this issue Oct 20, 2017 · 9 comments

Comments

@callegar
Copy link

Description of your problem

The IPython console prompt occasionally appears twice as in the following figure

screenshot_20171020_123800

This happens not just right after the startup of spyder, but also during the regular use of the console.

What steps will reproduce the problem?

  1. Start spyder
  2. Check the Ipython console
  3. Goto 1 until you see a prompt appearing twice

What is the expected output? What do you see instead?

You should always see a regular prompt. Occasionally, the prompt is repeated twice

Please provide any additional information below

May be related to issue 5408

Versions and main components

  • Spyder Version: 3.2.4
  • Python Version: 3.5.3
  • Qt Version: 5.7.1
  • PyQt Version: 5.7
  • Operating system: Kubuntu linux 17.04 + Kubuntu PPA

Dependencies

Please go to the menu entry Help > Optional Dependencies (or
Help > Dependencies), press the button Copy to clipboard
and paste the contents below:

IPython >=4.0 : 6.2.1 (OK)
cython >=0.21 : 0.27.1 (OK)
jedi >=0.9.0 : 0.11.0 (OK)
nbconvert >=4.0 : 5.3.1 (OK)
numpy >=1.7 : 1.13.3 (OK)
pandas >=0.13.1 : None (NOK)
psutil >=0.3 : 5.4.0 (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.7.4 (OK)
qtconsole >=4.2.0: 4.3.1 (OK)
rope >=0.9.4 : 0.10.7 (OK)
sphinx >=0.6.6 : 1.6.4 (OK)
sympy >=0.7.3 : None (NOK)

@callegar
Copy link
Author

Indeed in bug 5408 the prompt is also appearing twice

@ccordoba12
Copy link
Member

This is not really an error, it simply happens when the kernel of the corresponding console takes too much time to start.

Sorry for the inconvenience, but there's nothing we can do about it.

@callegar
Copy link
Author

Not just that. You see the double prompt also in other occasions. Certainly after a command errors out, I'll try to figure what else can trigger the double prompt.

With reference to the fact that the double prompt happens when the console takes too long to start, I wonder:

  1. This has started to happen recently. I was never seeing it until a few months ago. So, I guess, something must have made the console systematically slower to start (e.g., some package on which the console depends growing in size and load time, etc.)

  2. If the mechanism is managed with a timeout, allowing a slightly larger grace time to account for 1) could possibly help.

  3. Again, if the mechanism is managed with some timeout, making it configurable (even via a non-gui parameter) could help.

  4. Is there some bug report or enhancement request that can be filed to ipython in order to have it support some more reliable synchronization mechanism?

@jnsebgosselin
Copy link
Member

I've also noted this behaviour. I show a reproducible example below in case of an error:

double_prompt

@ccordoba12
Copy link
Member

Not just that. You see the double prompt also in other occasions. Certainly after a command errors out, I'll try to figure what else can trigger the double prompt.

That's by design. Please see pull request #4914 for our reasons to do it.

If the mechanism is managed with a timeout, allowing a slightly larger grace time to account for 1) could possibly help.

We have already done it: PR #5301.

Again, if the mechanism is managed with some timeout, making it configurable (even via a non-gui parameter) could help.

It's a minor annoyance. We already have plenty of configurations to add one more just for this.

Is there some bug report or enhancement request that can be filed to ipython

This only happens in Spyder because we do a lot of stuff when starting our kernels:

https://github.com/spyder-ide/spyder/blob/3.x/spyder/utils/ipython/start_kernel.py

@barathvb
Copy link

barathvb commented Jan 8, 2018

In addition to this issue, the ipython console on my spyder is printing errors twice. Please see below. I'm using Spyder 3.2.3 and PyQt4

`Python 2.7.11 |Anaconda 2.4.0 (64-bit)| (default, Jun 15 2016, 15:21:11) [MSC v.1500 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.

IPython 5.3.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.

In [1]:

In [1]: a
Traceback (most recent call last):

File "", line 1, in
a

NameError: name 'a' is not defined

Traceback (most recent call last):

File "", line 1, in
a

NameError: name 'a' is not defined

In [2]:

In [2]: `

@ccordoba12
Copy link
Member

I'm using Spyder 3.2.3 and PyQt4

Please move to PyQt5, that's most probably the cause. Although we still try to support it, PyQt4 is no longer maintained by Riverbank since several years ago.

@pjgorski
Copy link

pjgorski commented Jun 5, 2018

This is also happening to me. From few Spyder sessions there are often two propmts shown and each error produces two tracebacks:

In [6]: 3/0
Traceback (most recent call last):

  File "<ipython-input-6-a0641230c7a8>", line 1, in <module>
    3/0

ZeroDivisionError: division by zero

Traceback (most recent call last):

  File "<ipython-input-6-a0641230c7a8>", line 1, in <module>
    3/0

ZeroDivisionError: division by zero


In [7]: 

In [7]: 

I am using Spyder 3.2.3 (Anaconda does not show more recent versions) and PyQt5.

@ccordoba12
Copy link
Member

Any error produces two prompts in Spyder. We had to implement this to avoid hangs in certain situations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants