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

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

Closed
9 of 10 tasks
Lewn opened this issue Sep 3, 2018 · 10 comments
Closed
9 of 10 tasks

Comments

@Lewn
Copy link

Lewn commented Sep 3, 2018

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)
@ccordoba12
Copy link
Member

Please downgrade to ipykernel 4.8.2 and try again.

@Lewn
Copy link
Author

Lewn commented Sep 4, 2018

With IPykernel 4.8.2 it works again! Thank you very much.
Does this need to be added to the dependencies somewhere?

@ccordoba12
Copy link
Member

We're waiting for 4.9.1 to be released.

@wl935
Copy link

wl935 commented Sep 4, 2018

Many thanks! @ccordoba12
Problem solved!

@jeanbaptisteb
Copy link

jeanbaptisteb commented Sep 10, 2018

For the record, I had the exact same issue, but downgrading to IPykernel 4.8.2 didn't work right away.
I had to reset preferences with spyder --reset after the downgrade; then it worked.

@liangbright
Copy link

use this command.

conda install -c anaconda spyder ipykernel=4.8.2

It works on my Windows laptop

@Twizzledrizzle
Copy link

conda update ipykernel works for me (installed ipykernel 5.0)

@ralphcastro504
Copy link

Thanks @ccordoba12 downgrading solved my problem too.

@gauravmandhotra
Copy link

Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\runpy.py", line 193, in run_module_as_main
"main", mod_spec)
File "C:\ProgramData\Anaconda3\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\ProgramData\Anaconda3\lib\site‑packages\spyder_kernels\console_main
.py", line 11, in
start.main()
File "C:\ProgramData\Anaconda3\lib\site‑packages\spyder_kernels\console\start.py", line 279, in main
import_spydercustomize()
File "C:\ProgramData\Anaconda3\lib\site‑packages\spyder_kernels\console\start.py", line 39, in import_spydercustomize
import spydercustomize
File "C:\ProgramData\Anaconda3\lib\site‑packages\spyder_kernels\customize\spydercustomize.py", line 27, in
from IPython.core.getipython import get_ipython
File "C:\ProgramData\Anaconda3\lib\site‑packages\IPython_init
.py", line 54, in
from .core.application import Application
File "C:\ProgramData\Anaconda3\lib\site‑packages\IPython\core\application.py", line 23, in
from traitlets.config.application import Application, catch_config_error
File "C:\ProgramData\Anaconda3\lib\site‑packages\traitlets\config_init_.py", line 6, in
from .application import *
File "C:\ProgramData\Anaconda3\lib\site‑packages\traitlets\config\application.py", line 120, in
class Application(SingletonConfigurable):
File "C:\ProgramData\Anaconda3\lib\site‑packages\traitlets\config\application.py", line 291, in Application
def initialize(self, argv=None):
TypeError: wropper_functin() takes 0 positional arguments but 1 was givenTraceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\runpy.py", line 193, in run_module_as_main
"main", mod_spec)
File "C:\ProgramData\Anaconda3\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\ProgramData\Anaconda3\lib\site‑packages\spyder_kernels\console_main
.py", line 11, in
start.main()
File "C:\ProgramData\Anaconda3\lib\site‑packages\spyder_kernels\console\start.py", line 279, in main
import_spydercustomize()
File "C:\ProgramData\Anaconda3\lib\site‑packages\spyder_kernels\console\start.py", line 39, in import_spydercustomize
import spydercustomize
File "C:\ProgramData\Anaconda3\lib\site‑packages\spyder_kernels\customize\spydercustomize.py", line 27, in
from IPython.core.getipython import get_ipython
File "C:\ProgramData\Anaconda3\lib\site‑packages\IPython_init
.py", line 54, in
from .core.application import Application
File "C:\ProgramData\Anaconda3\lib\site‑packages\IPython\core\application.py", line 23, in
from traitlets.config.application import Application, catch_config_error
File "C:\ProgramData\Anaconda3\lib\site‑packages\traitlets\config_init_.py", line 6, in
from .application import *
File "C:\ProgramData\Anaconda3\lib\site‑packages\traitlets\config\application.py", line 120, in
class Application(SingletonConfigurable):
File "C:\ProgramData\Anaconda3\lib\site‑packages\traitlets\config\application.py", line 291, in Application
def initialize(self, argv=None):
TypeError: wropper_functin() takes 0 positional arguments but 1 was given

@gauravmandhotra
Copy link

how can I solve this error.when I fixed it one time and after reopen my spyder it show me this error again
can you give any solution of this erroe

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

No branches or pull requests

8 participants