spyder: An error ocurred while starting the kernel: b''

Issue Report Checklist

  • Searched the issues page for similar reports
  • [ x 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

I have seen a lot of posts of people who have the same error as I. I also get the message: b’’ Im unsure what it means.

This is a totally fresh installation on windows 10 on my laptop. I already installed anaconda + spyder on my desktop and it works without a problem. The installation on my laptop just doesn’t work.

What steps reproduce the problem?

  1. Download and install newest version of anaconda.
  2. Launch spyder
  3. (same procedure works fine on my desktop)

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

Paste Traceback/Error Below (if applicable)


Spyder Internal Console

This console is used to report application
internal errors and to inspect Spyder
internals with the following commands:
  spy.app, spy.window, dir(spy)

Please don't use it to run your code

>>> WARNING:traitlets:kernel died: 18.001706838607788

Versions

  • Spyder version: 3.3.2
  • Python version: 3.7
  • Qt version:
  • PyQt version:
  • Operating System name/version: Win10

Dependencies

IPython >=4.0     :  7.2.0 (OK)
cython >=0.21     :  0.29.2 (OK)
jedi >=0.9.0      :  0.13.2 (OK)
matplotlib >=2.0.0:  3.0.2 (OK)
nbconvert >=4.0   :  5.4.0 (OK)
numpy >=1.7       :  1.15.4 (OK)
pandas >=0.13.1   :  0.23.4 (OK)
pycodestyle >=2.3 :  2.4.0 (OK)
pyflakes >=0.6.0  :  2.0.0 (OK)
pygments >=2.0    :  2.3.1 (OK)
pylint >=0.25     :  2.2.2 (OK)
qtconsole >=4.2.0 :  4.4.3 (OK)
rope >=0.9.4      :  0.11.0 (OK)
sphinx >=0.6.6    :  1.8.2 (OK)
sympy >=0.7.3     :  1.3 (OK)

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 34 (18 by maintainers)

Most upvoted comments

I had the same problem with the following error and spent a few days searching the net for solutions / reinstalling a couple of times / nearly throwing my laptop out / giving up and gathering hope again / coming across this post to finally find a solution. Special thanks to @CAM-Gerlach and @vlfgns5

Here’s the step-by-step solution to what I did. I’m using a MacBook and Anaconda for python / Spyder

  • Installed Anaconda (c1.9.6) and through it Python in the (base) environment [EDIT: It’s version 2018.12 that I downloaded. The navigator Anaconda Navigator > About Anaconda Navigator states its Anaconda Navigator 1.9.6]
  • Through the Anaconda Navigator, created a new (deeplearning) environment where I installed Keras, Tensorflow, Theano, Numpy, Pandas, Matplotlib, Scikit-learn, Spyder-kernels (and various associated packages were automatically installed)
  • Using Terminal, in my (base) environment, I downgraded my Python from 3.7 to 3.6.8 so it would work with Keras [EDIT: This step is redundant and not required]
  • Using Terminal, went into my (deeplearning) environment and installed nomkl (it asked to downgraded some packages to which I said ok)
  • Still in my (deeplearning) environment in my Terminal, I typed python -c "import sys; print(sys.executable)" to get my path + copied the pathname
  • Opened Spyder through my (base) environment and navigated to Preferences > Python Interpreter > Use the following interpreter where I input my path
  • Restarted Spyder, again in the (base) environment and started coding. [EDIT: Restarting Spyder step is redundant and not required]

It all worked like a beauty. I can finally get on with learning more of this exciting field!

Thanks again everyone.

how to solve that problem

Update Spyder to its latest version (3.3.6).

Sure @CAM-Gerlach providing my list here…

I’m sure you’re right about not having to downgrade / restart / etc. I just happened to do those steps and, being a novice, I just decided to spell it out here rather than removing the redundant steps. However, your advise is very helpful. I’ve made some edits in my original response so others using it make note of it.

Actually, you don’t need to restart Spyder here. Rather, you only need to open a new console tab to start using the new environment. That way, you can easily switch environments and have multiple consoles from multiple environments open simultaneously without disrupting your session.

That’s really helpful to know. Thanks again!

I’m not familiar with that version number; 2018.12 should be the current one.

You’re right. It’s the 2018.12 one that I downloaded to install Anaconda. The navigator Anaconda Navigator > About Anaconda Navigator states its Anaconda Navigator 1.9.6

Conda Lists are noted here. I followed your instructions on putting it in 3 quotes - hope the formatting worked!

(base) environment conda list noted below

# Name                    Version                   Build  Channel
_ipyw_jlab_nb_ext_conf    0.1.0                    py36_0  
alabaster                 0.7.12                   py36_0  
anaconda-client           1.7.2                    py36_0  
anaconda-navigator        1.9.6                    py36_0  
anaconda-project          0.8.2                    py36_0  
appnope                   0.1.0            py36hf537a9a_0  
asn1crypto                0.24.0                   py36_0  
astroid                   2.1.0                    py36_0  
astropy                   3.1.1            py36h1de35cc_0  
atomicwrites              1.2.1                    py36_0  
attrs                     18.2.0           py36h28b3542_0  
babel                     2.6.0                    py36_0  
backcall                  0.1.0                    py36_0  
backports                 1.0                      py36_1  
backports.os              0.1.1                    py36_0  
backports.shutil_get_terminal_size 1.0.0                    py36_2  
beautifulsoup4            4.7.1                    py36_1  
bitarray                  0.8.3            py36h1de35cc_0  
bkcharts                  0.2              py36h073222e_0  
blas                      1.0                         mkl  
blaze                     0.11.3                   py36_0  
bleach                    3.1.0                    pypi_0    pypi
blosc                     1.14.4               hd9629dc_0  
bokeh                     1.0.4                    py36_0  
boto                      2.49.0                   py36_0  
bottleneck                1.2.1            py36h1d22016_1  
bzip2                     1.0.6                h1de35cc_5  
ca-certificates           2019.1.23                     0  
certifi                   2018.11.29               py36_0  
cffi                      1.11.5           py36h6174b99_1  
chardet                   3.0.4                    py36_1  
click                     7.0                      py36_0  
cloudpickle               0.7.0                      py_0  
clyent                    1.2.2                    py36_1  
colorama                  0.4.1                    py36_0  
conda                     4.6.2                    py36_0  
conda-build               3.17.8                   py36_0  
conda-env                 2.6.0                         1  
conda-verify              3.1.1                    py36_0  
contextlib2               0.5.5            py36hd66e5e7_0  
cryptography              2.4.2            py36ha12b0ac_0  
curl                      7.63.0            ha441bb4_1000  
cycler                    0.10.0           py36hfc81398_0  
cython                    0.29.4           py36h0a44026_0  
cytoolz                   0.9.0.1          py36h1de35cc_1  
dask                      1.1.1                      py_0  
dask-core                 1.1.1                      py_0  
datashape                 0.5.4                    py36_1  
dbus                      1.13.2               h760590f_1  
decorator                 4.3.2                    py36_0  
defusedxml                0.5.0                    py36_1  
distributed               1.25.3                   py36_0  
docutils                  0.14             py36hbfde631_0  
entrypoints               0.3                      py36_0  
et_xmlfile                1.0.1            py36h1315bdc_0  
expat                     2.2.6                h0a44026_0  
fastcache                 1.0.2            py36h1de35cc_2  
filelock                  3.0.10                   py36_0  
flask                     1.0.2                    py36_1  
flask-cors                3.0.7                    py36_0  
freetype                  2.9.1                hb4e5f40_0  
future                    0.17.1                   py36_0  
get_terminal_size         1.0.0                h7520d66_0  
gettext                   0.19.8.1             h15daf44_3  
gevent                    1.4.0            py36h1de35cc_0  
glib                      2.56.2               hd9629dc_0  
glob2                     0.6                      py36_1  
gmp                       6.1.2                hb37e062_1  
gmpy2                     2.0.8            py36h6ef4df4_2  
greenlet                  0.4.15           py36h1de35cc_0  
h5py                      2.8.0            py36h878fce3_3  
hdf5                      1.10.2               hfa1e0ec_1  
heapdict                  1.0.0                    py36_2  
html5lib                  1.0.1                    py36_0  
icu                       58.2                 h4b95b61_1  
idna                      2.8                      py36_0  
imageio                   2.4.1                    py36_0  
imagesize                 1.1.0                    py36_0  
importlib_metadata        0.7                      py36_0  
intel-openmp              2019.1                      144  
ipykernel                 5.1.0            py36h39e3cac_0  
ipython                   7.2.0            py36h39e3cac_0  
ipython_genutils          0.2.0            py36h241746c_0  
ipywidgets                7.4.2                    py36_0  
isort                     4.3.4                    py36_0  
itsdangerous              1.1.0                    py36_0  
jbig                      2.1                  h4d881f8_0  
jdcal                     1.4                      py36_0  
jedi                      0.13.2                   py36_0  
jinja2                    2.10                     py36_0  
jpeg                      9b                   he5867d9_2  
jsonschema                2.6.0            py36hb385e00_0  
jupyter                   1.0.0                    py36_7  
jupyter_client            5.2.4                    py36_0  
jupyter_console           6.0.0                    py36_0  
jupyter_core              4.4.0                    py36_0  
jupyterlab                0.35.3                   py36_0  
jupyterlab_server         0.2.0                    py36_0  
keyring                   17.1.1                   py36_0  
kiwisolver                1.0.1            py36h0a44026_0  
krb5                      1.16.1               hddcf347_7  
lazy-object-proxy         1.3.1            py36h1de35cc_2  
libarchive                3.3.3                h786848e_5  
libcurl                   7.63.0            h051b688_1000  
libcxx                    4.0.1                hcfea43d_1  
libcxxabi                 4.0.1                hcfea43d_1  
libedit                   3.1.20170329         hb402a30_2  
libffi                    3.2.1                h475c297_4  
libgfortran               3.0.1                h93005f0_2  
libiconv                  1.15                 hdd342a3_7  
liblief                   0.9.0                h2a1bed3_0  
libpng                    1.6.35               ha441bb4_0  
libsodium                 1.0.16               h3efe00b_0  
libssh2                   1.8.0                ha12b0ac_4  
libtiff                   4.0.9                hcb84e12_2  
libxml2                   2.9.8                hab757c2_1  
libxslt                   1.1.32               hb819dd2_0  
llvmlite                  0.27.0           py36h8c7ce04_0  
locket                    0.2.0            py36hca03003_1  
lxml                      4.3.0            py36hef8c89e_0  
lz4-c                     1.8.1.2              h1de35cc_0  
lzo                       2.10                 h362108e_2  
markupsafe                1.1.0            py36h1de35cc_0  
matplotlib                3.0.2            py36h54f8f79_0  
mccabe                    0.6.1                    py36_1  
mistune                   0.8.4            py36h1de35cc_0  
mkl                       2019.1                      144  
mkl-service               1.1.2            py36hfbe908c_5  
mkl_fft                   1.0.10           py36h5e564d8_0  
mkl_random                1.0.2            py36h27c97d8_0  
more-itertools            5.0.0                    py36_0  
mpc                       1.1.0                h6ef4df4_1  
mpfr                      4.0.1                h3018a27_3  
mpmath                    1.1.0                    py36_0  
msgpack-python            0.6.1            py36h04f5b5a_1  
multipledispatch          0.6.0                    py36_0  
navigator-updater         0.2.1                    py36_0  
nbconvert                 5.4.0                    py36_1  
nbformat                  4.4.0            py36h827af21_0  
ncurses                   6.1                  h0a44026_1  
networkx                  2.2                      py36_1  
nltk                      3.4                      py36_1  
nose                      1.3.7                    py36_2  
notebook                  5.7.4                    py36_0  
numba                     0.42.0           py36h6440ff4_0  
numexpr                   2.6.9            py36h7413580_0  
numpy                     1.15.4           py36hacdab7b_0  
numpy-base                1.15.4           py36h6575580_0  
numpydoc                  0.8.0                    py36_0  
odo                       0.5.1            py36hc1af34a_0  
olefile                   0.46                     py36_0  
openpyxl                  2.5.14                     py_0  
openssl                   1.1.1a               h1de35cc_0  
packaging                 19.0                     py36_0  
pandas                    0.24.1           py36h0a44026_0  
pandoc                    1.19.2.1             ha5e8f32_1  
pandocfilters             1.4.2                    py36_1  
parso                     0.3.2                    py36_0  
partd                     0.3.9                    py36_0  
path.py                   11.5.0                   py36_0  
pathlib2                  2.3.3                    py36_0  
patsy                     0.5.1                    py36_0  
pcre                      8.42                 h378b8a2_0  
pep8                      1.7.1                    py36_0  
pexpect                   4.6.0                    py36_0  
pickleshare               0.7.5                    py36_0  
pillow                    5.4.1            py36hb68e598_0  
pip                       19.0.1                   py36_0  
pkginfo                   1.5.0.1                  py36_0  
pluggy                    0.8.1                    py36_0  
ply                       3.11                     py36_0  
prometheus_client         0.5.0                    py36_0  
prompt_toolkit            2.0.8                      py_0  
psutil                    5.5.0            py36h1de35cc_0  
ptyprocess                0.6.0                    py36_0  
py                        1.7.0                    py36_0  
py-lief                   0.9.0            py36hd4eaf27_0  
pycodestyle               2.5.0                    py36_0  
pycosat                   0.6.3            py36h1de35cc_0  
pycparser                 2.19                     py36_0  
pycrypto                  2.6.1            py36h1de35cc_9  
pycurl                    7.43.0.2         py36ha12b0ac_0  
pyflakes                  2.1.0                    py36_0  
pygments                  2.3.1                    py36_0  
pylint                    2.2.2                    py36_0  
pyodbc                    4.0.25           py36h0a44026_0  
pyopenssl                 19.0.0                   py36_0  
pyparsing                 2.3.1                    py36_0  
pyqt                      5.9.2            py36h655552a_2  
pysocks                   1.6.8                    py36_0  
pytables                  3.4.4            py36h13cba08_0  
pytest                    4.2.0                    py36_0  
pytest-arraydiff          0.3              py36h39e3cac_0  
pytest-astropy            0.5.0                    py36_0  
pytest-doctestplus        0.2.0                    py36_0  
pytest-openfiles          0.3.2                    py36_0  
pytest-remotedata         0.3.1                    py36_0  
python                    3.6.8                haf84260_0  
python-dateutil           2.7.5                    py36_0  
python-libarchive-c       2.8                      py36_6  
python.app                2                        py36_9  
pytz                      2018.9                   py36_0  
pywavelets                1.0.1            py36h1d22016_0  
pyyaml                    3.13             py36h1de35cc_0  
pyzmq                     17.1.2           py36h1de35cc_0  
qt                        5.9.7                h468cd18_1  
qtawesome                 0.5.6                      py_0  
qtconsole                 4.4.3                    py36_0  
qtpy                      1.6.0                      py_0  
readline                  7.0                  h1de35cc_5  
requests                  2.21.0                   py36_0  
rope                      0.11.0                   py36_0  
ruamel_yaml               0.15.46          py36h1de35cc_0  
scikit-image              0.14.1           py36h0a44026_0  
scikit-learn              0.20.2           py36h27c97d8_0  
scipy                     1.2.0            py36h1410ff5_0  
seaborn                   0.9.0                    py36_0  
send2trash                1.5.0                    py36_0  
setuptools                40.7.3                   py36_0  
simplegeneric             0.8.1                    py36_2  
singledispatch            3.4.0.3          py36hf20db9d_0  
sip                       4.19.8           py36h0a44026_0  
six                       1.12.0                   py36_0  
snappy                    1.1.7                he62c110_3  
snowballstemmer           1.2.1            py36h6c7b616_0  
sortedcollections         1.1.2                    py36_0  
sortedcontainers          2.1.0                    py36_0  
soupsieve                 1.7.1                    py36_0  
sphinx                    1.8.4                    py36_0  
sphinxcontrib             1.0                      py36_1  
sphinxcontrib-websupport  1.1.0                    py36_1  
spyder                    3.3.2                    py36_0  
spyder-kernels            0.3.0                    py36_0  
sqlalchemy                1.2.17           py36h1de35cc_0  
sqlite                    3.26.0               ha441bb4_0  
statsmodels               0.9.0            py36h1d22016_0  
sympy                     1.3                      py36_0  
tblib                     1.3.2            py36hda67792_0  
terminado                 0.8.1                    py36_1  
testpath                  0.4.2                    py36_0  
tk                        8.6.8                ha441bb4_0  
toolz                     0.9.0                    py36_0  
tornado                   5.1.1            py36h1de35cc_0  
tqdm                      4.29.1                     py_0  
traitlets                 4.3.2            py36h65bd3ce_0  
typed-ast                 1.1.0            py36h1de35cc_0  
unicodecsv                0.14.1           py36he531d66_0  
unixodbc                  2.3.7                h1de35cc_0  
urllib3                   1.24.1                   py36_0  
wcwidth                   0.1.7            py36h8c6ec74_0  
webencodings              0.5.1                    py36_1  
werkzeug                  0.14.1                   py36_0  
wheel                     0.32.3                   py36_0  
widgetsnbextension        3.4.2                    py36_0  
wrapt                     1.11.0           py36h1de35cc_0  
wurlitzer                 1.0.2                    py36_0  
xlrd                      1.2.0                    py36_0  
xlsxwriter                1.1.2                    py36_0  
xlwings                   0.15.2                   py36_0  
xlwt                      1.2.0            py36h5ad1178_0  
xz                        5.2.4                h1de35cc_4  
yaml                      0.1.7                hc338f04_2  
zeromq                    4.2.5                h0a44026_1  
zict                      0.1.3                    py36_0  
zlib                      1.2.11               h1de35cc_3  
zstd                      1.3.7                h5bba6e5_0  

(deeplearning) environment Conda list noted below

# Name                    Version                   Build  Channel
_tflow_select             2.3.0                       mkl  
absl-py                   0.7.0                    py36_0  
appnope                   0.1.0            py36hf537a9a_0  
astor                     0.7.1                    py36_0  
backcall                  0.1.0                    py36_0  
blas                      1.0                    openblas  
c-ares                    1.15.0               h1de35cc_1  
ca-certificates           2019.1.23                     0  
cctools                   895                           1  
certifi                   2018.11.29               py36_0  
clang                     4.0.1                         1  
clang_osx-64              4.0.1               h1ce6c1d_11  
clangxx                   4.0.1                         1  
clangxx_osx-64            4.0.1               h22b1bf0_11  
cloudpickle               0.7.0                      py_0  
compiler-rt               4.0.1                hcfea43d_1  
cycler                    0.10.0           py36hfc81398_0  
decorator                 4.3.2                    py36_0  
freetype                  2.9.1                hb4e5f40_0  
gast                      0.2.2                    py36_0  
grpcio                    1.16.1           py36h044775b_1  
h5py                      2.9.0            py36h3134771_0  
hdf5                      1.10.4               hfa1e0ec_0  
intel-openmp              2019.1                      144  
ipykernel                 5.1.0            py36h39e3cac_0  
ipython                   7.2.0            py36h39e3cac_0  
ipython_genutils          0.2.0            py36h241746c_0  
jedi                      0.13.2                   py36_0  
jpeg                      9b                   he5867d9_2  
jupyter_client            5.2.4                    py36_0  
jupyter_core              4.4.0                    py36_0  
keras                     2.2.4                         0  
keras-applications        1.0.6                    py36_0  
keras-base                2.2.4                    py36_0  
keras-preprocessing       1.0.5                    py36_0  
kiwisolver                1.0.1            py36h0a44026_0  
ld64                      274.2                         1  
libcxx                    4.0.1                hcfea43d_1  
libcxxabi                 4.0.1                hcfea43d_1  
libedit                   3.1.20181209         hb402a30_0  
libffi                    3.2.1                h475c297_4  
libgfortran               3.0.1                h93005f0_2  
libopenblas               0.3.3                hdc02c5d_3  
libpng                    1.6.36               ha441bb4_0  
libprotobuf               3.6.1                hd9629dc_0  
libsodium                 1.0.16               h3efe00b_0  
libtiff                   4.0.10               hcb84e12_2  
llvm                      4.0.1                         1  
llvm-lto-tapi             4.0.1                         1  
markdown                  3.0.1                    py36_0  
matplotlib                3.0.2            py36h54f8f79_0  
mkl                       2019.1                      144  
mkl-service               1.1.2                    py36_3  
mkl_fft                   1.0.1            py36h917ab60_0  
mkl_random                1.0.1            py36h78cc56f_0  
ncurses                   6.1                  h0a44026_1  
nomkl                     3.0                           0  
numpy                     1.15.4           py36h926163e_0  
numpy-base                1.15.4           py36ha711998_0  
olefile                   0.46                     py36_0  
openssl                   1.1.1a               h1de35cc_0  
pandas                    0.24.1           py36h0a44026_0  
parso                     0.3.2                    py36_0  
pexpect                   4.6.0                    py36_0  
pickleshare               0.7.5                    py36_0  
pillow                    5.4.1            py36hb68e598_0  
pip                       19.0.1                   py36_0  
prompt_toolkit            2.0.8                      py_0  
protobuf                  3.6.1            py36h0a44026_0  
ptyprocess                0.6.0                    py36_0  
pygments                  2.3.1                    py36_0  
pyparsing                 2.3.1                    py36_0  
python                    3.6.8                haf84260_0  
python-dateutil           2.7.5                    py36_0  
pytz                      2018.9                   py36_0  
pyyaml                    3.13             py36h1de35cc_0  
pyzmq                     17.1.2           py36h0a44026_2  
readline                  7.0                  h1de35cc_5  
scikit-learn              0.20.2           py36hebd9d1a_0  
scipy                     1.2.0            py36h1a1e112_0  
setuptools                40.7.3                   py36_0  
six                       1.12.0                   py36_0  
spyder-kernels            0.3.0                    py36_0  
sqlite                    3.26.0               ha441bb4_0  
tensorboard               1.12.2           py36haf313ee_0  
tensorflow                1.12.0          mkl_py36h2b2bbaf_0  
tensorflow-base           1.12.0          mkl_py36h70e0e9a_0  
termcolor                 1.1.0                    py36_1  
theano                    1.0.3            py36h04f5b5a_0  
tk                        8.6.8                ha441bb4_0  
tornado                   5.1.1            py36h1de35cc_0  
traitlets                 4.3.2            py36h65bd3ce_0  
wcwidth                   0.1.7            py36h8c6ec74_0  
werkzeug                  0.14.1                   py36_0  
wheel                     0.32.3                   py36_0  
wurlitzer                 1.0.2                    py36_0  
xz                        5.2.4                h1de35cc_4  
yaml                      0.1.7                hc338f04_2  
zeromq                    4.3.1                h0a44026_3  
zlib                      1.2.11               h1de35cc_3  
zstd                      1.3.7                h5bba6e5_0  

Thanks so much @kkumar949 for your detailed and helpful description of how you worked around this, and I’m glad you were able to resolve it after all that hard work. It seems the issue may lie with one of the package versions in the base environment that one of your ML packages doesn’t like. Can you post your conda list of your base environment and your deeplearning environment inside details tags for reference?


<details>

```
POST CONDA LIST HERE
```

</details>

Also, some comments on your steps:

Installed Anaconda (c1.9.6)

I’m not familiar with that version number; 2018.12 should be the current one.

Using Terminal, in my (base) environment, I downgraded my Python from 3.7 to 3.6.8 so it would work with Keras

This shouldn’t be necessary, because you are installing keras, etc. in your deeplearning environment while your base env is only being used for Spyder (you can even do this with Python 3 Spyder and Python 2 working env or vice versa, though that’s not recommended). You don’t need to manually downgrade; conda will do it for you when installing keras (which it presumably did in your new deeplearning environment if you’d initially installed 3.7 there).

Restarted Spyder, again in the (base) environment and started coding.

Actually, you don’t need to restart Spyder here. Rather, you only need to open a new console tab to start using the new environment. That way, you can easily switch environments and have multiple consoles from multiple environments open simultaneously without disrupting your session.