Spyder不会连接到kernel / iPython控制台

时间:2015-11-19 21:44:13

标签: python spyder

由于昨晚我的笔记本电脑崩溃(原因不明),Spyder无法连接到内核。我收到了这个错误:

IOError: Could not find u'kernel-1809.json' in ['.', '~/Library/Jupyter/runtime']

(每次尝试启动iPython控制台时,json文件的名称都会更改。)

这似乎与matplotlib 1.5问题没有关系,我在其他地方已经看过 - 它使用的是1.4.3。

iPython(版本4.0.0)从命令行运行良好。

Mac 10.10.1(约塞米蒂)。 Spyder 2.3.7。达尔文的Python 2.7.10 64位,Qt 4.8.7,PyQt4(API v2)4.11.3

更新包含日志

>>> /Volumes/Spyder-Py2/Spyder-Py2.app/Contents/Resources/lib/python2.7/nbformat/current.py:19: UserWarning: nbformat.current is deprecated.

- use nbformat for read/write/validate public API
- use nbformat.vX directly to composing notebooks of a particular version

ERROR: 3rd party plugin import failed for `p_pylint`
Traceback (most recent call last):
  File "/Volumes/Spyder-Py2/Spyder-Py2.app/Contents/Resources/lib/python2.7/spyderlib/otherplugins.py", line 53, in get_spyderplugins_mods
  File "/Volumes/Spyder-Py2/Spyder-Py2.app/Contents/Resources/lib/python2.7/spyderplugins/p_pylint.py", line 23, in <module>
  File "/Volumes/Spyder-Py2/Spyder-Py2.app/Contents/Resources/lib/python2.7/spyderplugins/widgets/pylintgui.py", line 71, in <module>
  File "/Volumes/Spyder-Py2/Spyder-Py2.app/Contents/Resources/lib/python2.7/spyderplugins/widgets/pylintgui.py", line 61, in get_pylint_version
  File "subprocess.pyc", line 710, in __init__
  File "subprocess.pyc", line 1335, in _execute_child
OSError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/Volumes/Spyder-Py2/Spyder-Py2.app/Contents/Resources/lib/python2.7/spyderlib/plugins/externalconsole.py", line 925, in <lambda>
give_focus=give_ipyclient_focus))
  File "/Volumes/Spyder-Py2/Spyder-Py2.app/Contents/Resources/lib/python2.7/spyderlib/plugins/externalconsole.py", line 1033, in register_ipyclient
give_focus=give_focus)
  File "/Volumes/Spyder-Py2/Spyder-Py2.app/Contents/Resources/lib/python2.7/spyderlib/plugins/ipythonconsole.py", line 836, in register_client
self.connect_client_to_kernel(client)
  File "/Volumes/Spyder-Py2/Spyder-Py2.app/Contents/Resources/lib/python2.7/spyderlib/plugins/ipythonconsole.py", line 1048, in connect_client_to_kernel
client.password)
  File "/Volumes/Spyder-Py2/Spyder-Py2.app/Contents/Resources/lib/python2.7/spyderlib/plugins/ipythonconsole.py", line 1017, in create_kernel_manager_and_client
cf = find_connection_file(connection_file)
  File "/Volumes/Spyder-Py2/Spyder-Py2.app/Contents/Resources/lib/python2.7/jupyter_client/connect.py", line 185, in find_connection_file
raise IOError("Could not find %r in %r" % (filename, path))
IOError: Could not find u'kernel-2018.json' in ['.', u'/Users/garyspatterson/Library/Jupyter/runtime']

**进一步更新**

我删除了用户目录中.spyder2 /文件夹下的所有文件,重新打开了Spyder,并且能够连接到iPython控制台。到现在为止还挺好。麻烦的是,当我添加一个PYTHONPATH管理器的路径(所以我可以导入外部模块,如nltk)时,我又回到了同样的错误。

1 个答案:

答案 0 :(得分:0)

有一个类似的问题,并且能够通过创建一个安装了相同依赖项的新virtualenv来解决它。 现在,Spyder正在使用PYTHONPATH指向新环境的lib/python2.7/site-packages