spyder: Python console not working properly on Spyder 3

Description of your problem

What steps will reproduce the problem?

  1. Copy and paste the snippet below in the editor.
  2. Open a new Python console (not IPython, but python)
  3. Select the snippet in the editor and run with F9

Snippet:

import numpy as np

print “starting”

perspec_start = -2 perspec_bin_num = 80 perspec_stop = 0.56 time_bins = np.linspace(start=perspec_start, stop=perspec_stop, num=perspec_bin_num, endpoint=False) dummy = 1+1 print dummy

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

Once the snippet gets executed I expect to see “2” printed in the console. Instead of that nothing comes out, just the prompt. If now you press enter again in the console, 2 finally comes.

Expected (as seen in spyder 2.3.9 Python console):

>>> import numpy as np >>> >>> print “starting” starting >>> >>> perspec_start = -2 >>> perspec_bin_num = 80 >>> perspec_stop = 0.56 >>> time_bins = np.linspace(start=perspec_start, stop=perspec_stop, num=perspec_bin_num, endpoint=False) >>> dummy = 1+1 >>> print dummy 2 >>>

Bug Seen in spyder 3.0.2

>>> import numpy as np >>> >>> print “starting” starting >>> >>> perspec_start = -2 >>> perspec_bin_num = 80 >>> >>> perspec_stop = 0.56 >>> time_bins = np.linspace(start=perspec_start, stop=perspec_stop, num=perspec_bin_num, endpoint=False) dummy = 1+1 >>> print dummy >>> (now you push enter) 2 >>>

Please provide any additional information below

The snippet is the very minimum code I have found to reproduce the problem. When working with a larger script, this bug becomes an issue as the non-executed-waiting-for-enter-to-be-executed lines accumulate and makes very difficult to work with. You can try that by writing a second print dummy statement: first the empty prompt comes, after the first enter the first 2 comes, and then an empty prompt, and only after the second enter the second 2 comes.

This problem is not there in spyder 2.3.9. The problem is also not seen with IPython, however, I am working with some libraries that do not play well with IPython and therefore I have to use the Python console.

Versions and main components

  • Spyder Version: 3.0.2
  • Python Version: 2.7.13
  • Operating system: Windows 7

Dependencies

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

jedi >=0.8.1 : 0.9.0 (OK) matplotlib >=1.0 : 1.5.3 (OK) nbconvert >=4.0 : 4.2.0 (OK) numpy >=1.7 : 1.11.2 (OK) pandas >=0.13.1 : 0.19.1 (OK) pep8 >=0.6 : 1.7.0 (OK) pyflakes >=0.5.0 : 1.3.0 (OK) pygments >=2.0 : 2.1.3 (OK) pylint >=0.25 : 1.5.4 (OK) qtconsole >=4.2.0: 4.2.1 (OK) rope >=0.9.4 : 0.9.4 (OK) sphinx >=0.6.6 : 1.5.1 (OK) sympy >=0.7.3 : None (NOK)

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 18 (9 by maintainers)

Most upvoted comments

Hi, I understand your reasons, but I think that removing the Python console will be a big mistake. The IPyhton console has a lot of drawbacks, for example:

  • The debugger does not provide command history.
  • Cannot do interactive plotting while debugging.

I spent so much time configuring the Pyhon console to make it work with similar debugging and plotting capabilities as MATLAB. It was impossible with IPython.

Unfortunately, It seems that I will need to switch for another IDE.