ImportError:在Windows中没有使用enthought命名路径ipython notebook和bokeh的模块

时间:2016-06-11 18:49:31

标签: python ipython enthought bokeh jupyter-notebook

我在尝试在Ipython笔记本中使用散景运行情节时收到以下错误

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-128-bedfa82edaf4> in <module>()
  9 p.line(logged_ts.index, logged_ts[[1]], color='navy', alpha=0.5)
 10 
---> 11 show(p)

C:\Users\user\AppData\Local\Enthought\Canopy\User\lib\site-packages\bokeh\io.pyc in show(obj, browser, new)
299 
300     '''
--> 301     return _show_with_state(obj, _state, browser, new)
302 
303 def _show_with_state(obj, state, browser, new):

C:\Users\user\AppData\Local\Enthought\Canopy\User\lib\site-packages\bokeh\io.pyc in _show_with_state(obj, state, browser, new)
307 
308     if state.notebook:
--> 309         comms_handle = _show_notebook_with_state(obj, state)
310 
311     elif state.server_enabled:

C:\Users\user\AppData\Local\Enthought\Canopy\User\lib\site-packages\bokeh\io.pyc in _show_notebook_with_state(obj, state)
329         comms_target = make_id()
330         publish_display_data({'text/html': notebook_div(obj, comms_target)})
--> 331         handle = _CommsHandle(get_comms(comms_target), state.document, state.document.to_json())
332         state.last_comms_handle = handle
333         return handle

C:\Users\user\AppData\Local\Enthought\Canopy\User\lib\site-packages\bokeh\util\notebook.pyc in get_comms(target_name)
109 
110     '''
--> 111     from ipykernel.comm import Comm
112     return Comm(target_name=target_name, data={})
113 

C:\Users\user\AppData\Local\Enthought\Canopy\User\lib\site-packages\ipykernel\__init__.py in <module>()
  1 from ._version import version_info, __version__, kernel_protocol_version_info, kernel_protocol_version
 ----> 2 from .connect import *

 C:\Users\user\AppData\Local\Enthought\Canopy\User\lib\site-packages\ipykernel\connect.py in <module>()
 12 
 13 from IPython.core.profiledir import ProfileDir
---> 14 from IPython.paths import get_ipython_dir
 15 from ipython_genutils.path import filefind
16 from ipython_genutils.py3compat import str_to_bytes

ImportError: No module named paths

我已经尝试使用pip和package manager卸载ipython包而没有结果。 任何帮助将不胜感激,问候!

1 个答案:

答案 0 :(得分:1)

当您将pip与已经与软件包管理器一起安装的软件包(包括与Canopy捆绑在一起的软件包)一起使用时,您可能最终会遇到不兼容的文件混合。我建议您卸载Canopy 1.5.2并安装当前版本1.7.2。在重新启动Canopy之前,请务必删除Canopy创建的其他目录。见https://support.enthought.com/entries/23580651-Uninstalling-and-resetting-Canopy

特别是(无论您是否更新到Canopy 1.7.2),您需要在重新启动Canopy之前删除此目录:C:\Users\user\AppData\Local\Enthought\Canopy\User\