question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IPython Console fails to start (An error ocurred while starting the kernel)

See original GitHub issue

Hi,

After installing a clean installation of spyder on Windows, the IPython console fails to start.

note: I am using the conda-forge channel

> conda update conda
output skipped, update successfull
>type spydertest.yaml
name: spydertest
channels:
  - conda-forge
dependencies:
  - python=3.6
  - spyder
> conda env create -f spydertest.yaml
output skipped, install successfull
>conda activate spydertest
>conda list
# packages in environment at C:\ProgramData\Miniconda3\envs\spydertest:
#
# Name                    Version                   Build  Channel
alabaster                 0.7.11                     py_3    conda-forge
asn1crypto                0.24.0                   py36_3    conda-forge
astroid                   2.0.2                    py36_0    conda-forge
babel                     2.6.0                      py_1    conda-forge
backcall                  0.1.0                      py_0    conda-forge
bleach                    2.1.4                      py_1    conda-forge
ca-certificates           2018.8.24            ha4d7672_0    conda-forge
certifi                   2018.8.24                py36_0    conda-forge
cffi                      1.11.5           py36hfa6e2cd_1    conda-forge
chardet                   3.0.4                    py36_3    conda-forge
cloudpickle               0.5.5                      py_0    conda-forge
colorama                  0.3.9                      py_1    conda-forge
cryptography              2.3.1            py36h74b6da3_0    conda-forge
cryptography-vectors      2.3.1                    py36_0    conda-forge
decorator                 4.3.0                      py_0    conda-forge
docutils                  0.14                     py36_1    conda-forge
entrypoints               0.2.3                    py36_2    conda-forge
html5lib                  1.0.1                      py_0    conda-forge
icu                       58.2                     vc14_0  [vc14]  conda-forge
idna                      2.7                      py36_2    conda-forge
imagesize                 1.1.0                      py_0    conda-forge
ipykernel                 4.9.0                    py36_0    conda-forge
ipython                   6.5.0                    py36_0    conda-forge
ipython_genutils          0.2.0                      py_1    conda-forge
isort                     4.3.4                    py36_0    conda-forge
jedi                      0.12.1                   py36_0    conda-forge
jinja2                    2.10                       py_1    conda-forge
jpeg                      9b                       vc14_2  [vc14]  conda-forge
jsonschema                2.6.0                    py36_2    conda-forge
jupyter_client            5.2.3                      py_1    conda-forge
jupyter_core              4.4.0                      py_0    conda-forge
keyring                   13.2.1                   py36_0    conda-forge
lazy-object-proxy         1.3.1            py36hfa6e2cd_0    conda-forge
libpng                    1.6.34                   vc14_0  [vc14]  conda-forge
libsodium                 1.0.16                   vc14_0  [vc14]  conda-forge
markupsafe                1.0              py36hfa6e2cd_1    conda-forge
mccabe                    0.6.1                      py_1    conda-forge
mistune                   0.8.3            py36hfa6e2cd_2    conda-forge
nbconvert                 5.3.1                      py_1    conda-forge
nbformat                  4.4.0                      py_1    conda-forge
numpydoc                  0.8.0                      py_1    conda-forge
openssl                   1.0.2o                   vc14_0  [vc14]  conda-forge
packaging                 17.1                       py_0    conda-forge
pandoc                    2.2.2                hde52d81_1    conda-forge
pandocfilters             1.4.2                      py_1    conda-forge
parso                     0.3.1                      py_0    conda-forge
pickleshare               0.7.4                    py36_0    conda-forge
pip                       18.0                     py36_1    conda-forge
prompt_toolkit            1.0.15                     py_1    conda-forge
psutil                    5.4.7            py36hfa6e2cd_1    conda-forge
pycodestyle               2.4.0                      py_1    conda-forge
pycparser                 2.18                       py_1    conda-forge
pyflakes                  2.0.0                      py_0    conda-forge
pygments                  2.2.0                      py_1    conda-forge
pylint                    2.1.1                    py36_0    conda-forge
pyopenssl                 18.0.0                   py36_0    conda-forge
pyparsing                 2.2.0                      py_1    conda-forge
pyqt                      5.6.0            py36h764d66f_7    conda-forge
pysocks                   1.6.8                    py36_2    conda-forge
python                    3.6.6                he025d50_0    conda-forge
python-dateutil           2.7.3                      py_0    conda-forge
pytz                      2018.5                     py_0    conda-forge
pywin32-ctypes            0.2.0                    py36_0    conda-forge
pyzmq                     17.1.2           py36hf576995_0    conda-forge
qt                        5.6.2                    vc14_1  [vc14]  conda-forge
qtawesome                 0.4.4              pyh8a2030e_1    conda-forge
qtconsole                 4.4.1                    py36_1    conda-forge
qtpy                      1.5.0              pyh8a2030e_0    conda-forge
requests                  2.19.1                   py36_1    conda-forge
rope                      0.10.7                     py_1    conda-forge
setuptools                40.2.0                   py36_0    conda-forge
simplegeneric             0.8.1                      py_1    conda-forge
sip                       4.18.1           py36h6538335_0    conda-forge
six                       1.11.0                   py36_1    conda-forge
snowballstemmer           1.2.1                      py_1    conda-forge
sphinx                    1.7.8                    py36_0    conda-forge
sphinxcontrib-websupport  1.1.0                      py_1    conda-forge
spyder                    3.3.1                    py36_1    conda-forge
spyder-kernels            0.2.6                      py_0    conda-forge
testpath                  0.3.1                    py36_1    conda-forge
tornado                   5.1              py36hfa6e2cd_1    conda-forge
traitlets                 4.3.2                    py36_0    conda-forge
typed-ast                 1.1.0                    py36_0    conda-forge
urllib3                   1.23                     py36_1    conda-forge
vc                        14                            0    conda-forge
vs2015_runtime            14.0.25420                    0    conda-forge
wcwidth                   0.1.7                      py_1    conda-forge
webencodings              0.5.1                      py_1    conda-forge
wheel                     0.31.1                   py36_1    conda-forge
win_inet_pton             1.0.1                    py36_2    conda-forge
wincertstore              0.2                      py36_2    conda-forge
wrapt                     1.10.11                  py36_0    conda-forge
zeromq                    4.2.5                    vc14_2  [vc14]  conda-forge
zlib                      1.2.11                   vc14_0  [vc14]  conda-forge

>ipython
Python 3.6.6 | packaged by conda-forge | (default, Jul 26 2018, 11:48:23) [MSC v.1900 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 6.5.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: 1
Out[1]: 1

In [2]: exit

> spyder

Now spyder starts up nicely, but the iPython console does not start, and gives the following traceback:

Traceback (most recent call last):
File "C:\ProgramData\Miniconda3\envs\spydertest\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\ProgramData\Miniconda3\envs\spydertest\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\ProgramData\Miniconda3\envs\spydertest\lib\site‑packages\spyder_kernels\console\__main__.py", line 11, in 
start.main()
File "C:\ProgramData\Miniconda3\envs\spydertest\lib\site‑packages\spyder_kernels\console\start.py", line 284, in main
kernel.initialize()
File "", line 2, in initialize
File "C:\ProgramData\Miniconda3\envs\spydertest\lib\site‑packages\traitlets\config\application.py", line 87, in catch_config_error
return method(app, *args, **kwargs)
File "C:\ProgramData\Miniconda3\envs\spydertest\lib\site‑packages\ipykernel\kernelapp.py", line 474, in initialize
self.init_io()
File "C:\ProgramData\Miniconda3\envs\spydertest\lib\site‑packages\ipykernel\kernelapp.py", line 326, in init_io
sys.stdout.flush()
AttributeError: 'NoneType' object has no attribute 'flush'

Issue Report Checklist

  • Searched the issues page for similar reports
  • Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • Could not reproduce inside jupyter qtconsole (if console-related)
  • Tried basic troubleshooting (if a bug/error)
    • Restarted Spyder
    • Reset preferences with spyder --reset
    • Reinstalled the latest version of Anaconda
    • Tried the other applicable steps from the Troubleshooting Guide
  • Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

When starting Spyder, the Ipython console fails to start. A raw ipython console will start correctly from the command line, as well as a jupyter qtconsole.

What steps reproduce the problem?

  1. Install Spyder in a fresh conda env with python 3.6 and conda-forge
  2. Run spyder
  3. No Ipython console 😦

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

Wanted: A working Ipython console Got: An error ocurred while starting the kernel

Paste Traceback/Error Below (if applicable)

Also see above


>>> WARNING:traitlets:kernel restarted
WARNING:traitlets:kernel restarted
WARNING:traitlets:kernel restarted
WARNING:traitlets:kernel restarted
WARNING:traitlets:KernelRestarter: restart failed
WARNING:traitlets:kernel died: 18.001529455184937


Versions

  • Spyder version: 3.3.1
  • Python version: 3.6.6
  • Qt version: 5.6.2
  • PyQt version: 5.6.0
  • Operating System name/version: Windows 10

Dependencies

IPython >=4.0     :  6.5.0 (OK)
cython >=0.21     :  None (NOK)
jedi >=0.9.0      :  0.12.1 (OK)
matplotlib >=2.0.0:  None (NOK)
nbconvert >=4.0   :  5.3.1 (OK)
numpy >=1.7       :  None (NOK)
pandas >=0.13.1   :  None (NOK)
pycodestyle >=2.3 :  2.4.0 (OK)
pyflakes >=0.6.0  :  2.0.0 (OK)
pygments >=2.0    :  2.2.0 (OK)
pylint >=0.25     :  2.1.1 (OK)
qtconsole >=4.2.0 :  4.4.1 (OK)
rope >=0.9.4      :  0.10.7 (OK)
sphinx >=0.6.6    :  1.7.8 (OK)
sympy >=0.7.3     :  None (NOK)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

14reactions
ccordoba12commented, Sep 3, 2018

Please downgrade to ipykernel 4.8.2 and try again.

5reactions
liangbrightcommented, Sep 10, 2018

use this command.

conda install -c anaconda spyder ipykernel=4.8.2

It works on my Windows laptop

Read more comments on GitHub >

github_iconTop Results From Across the Web

"An error ocurred while starting the kernel" about wrong ...
That should fix your problem, which is most likely caused by not having the right version of Spyder-kernels in the environment you have...
Read more >
Common Illnesses — Spyder 5 documentation
If you receive the message An error occurred while starting the kernel in the IPython Console, Spyder was unable to launch a new...
Read more >
Why am I getting "An error ocurred while starting the kernel" in ...
I have checked the PATH environment variable and everything is correct. Here is the detailed error received in the console while trying to ......
Read more >
IPython console: an error ocurred while starting the kernel Either
I install the anaconda, then change the default python interpreter to ArcGIS 10.3 python2.7.8 win32 in preference--console--advanced setting, but when i ...
Read more >
How to fix Kernel Error or broken Python in Jupyter Notebook
TL;DW BELOW! If you delete or upgrade your python version, you might get a Kernel Error when trying to use Jupyter Notebooks!
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found