Stephen
Stephen

Reputation: 8790

how can I show all warnings in the iPython console in Spyder?

The iPython console in Spyder (when run from within a tab in Spyder) seems to strip warnings by default. This behavior is different from the iPython console run on its own.

It is easy to reproduce. Create a file containing only the following:

import sys
print sys.argv

Note that this is invalid Python 3 because print does not have parentheses. Run this within iPython (not within Spyder) and you will see the following:

In [305]: run test.py test args
  File "C:\Users\sdewey\Documents\intro to ML with python\test.py", line 13
    print sys.argv
        ^
SyntaxError: Missing parentheses in call to 'print'

If you run the same thing within the iPython tab within Spyder, you'll get a blank response:

In [9]: run test.py test args

In [10]: 

Note that if you run a program which does not have errors, you will see the result in Spyder as usual. For example if you fix the parentheses here, you will see the printed argv in the console. Only error output seems to be impacted, not standard output.

I obtained this copy of Spyder through Anaconda 4.3.1. This is Spyder 3.1.2, Python 3.6. I've looked through the Spyder preferences, but haven't seen anything that addresses what to do with failures.

My working hypothesis is that this has something to do with error output vs standard output. This is a Windows installation so I don't think there are different streams but I could be mistaken.

Upvotes: 0

Views: 3060

Answers (1)

Carlos Cordoba
Carlos Cordoba

Reputation: 34136

(Spyder developer here) You need to update the qtconsole package to its version 4.3 to fix this error.

If you are using Anaconda, you need to open a terminal (cmd.exe) and run this command

conda update qtconsole

If not, you need to run

pip install -U qtconsole

Upvotes: 1

Related Questions