jupyter笔记本显示带有Python和virtualenv的内核错误

时间:2019-01-20 20:54:21

标签: python jupyter-notebook jupyter

我已经将jupyter安装到我的virtualenv中。打开笔记本后,出现此内核错误:

Traceback (most recent call last):
  File "D:\Program Files\Python3.7\Lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "D:\Program Files\Python3.7\Lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "D:\Projects\sample_project\venv37\lib\site-packages\ipykernel_launcher.py", line 16, in <module>
    app.launch_new_instance()
  File "D:\Projects\sample_project\venv37\lib\site-packages\traitlets\config\application.py", line 657, in launch_instance
    app.initialize(argv)
  File "<decorator-gen-124>", line 2, in initialize
  File "D:\Projects\sample_project\venv37\lib\site-packages\traitlets\config\application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "D:\Projects\sample_project\venv37\lib\site-packages\ipykernel\kernelapp.py", line 484, in initialize

    self.init_kernel()
  File "D:\Projects\sample_project\venv37\lib\site-packages\ipykernel\kernelapp.py", line 389, in init_kernel
    user_ns=self.user_ns,
  File "D:\Projects\sample_project\venv37\lib\site-packages\traitlets\config\configurable.py", line 412, in instance
    inst = cls(*args, **kwargs)
  File "D:\Projects\sample_project\venv37\lib\site-packages\ipykernel\ipkernel.py", line 67, in __init__
    kernel      = self,
  File "D:\Projects\sample_project\venv37\lib\site-packages\traitlets\config\configurable.py", line 412, in instance
    inst = cls(*args, **kwargs)
  File "D:\Projects\sample_project\venv37\lib\site-packages\IPython\core\interactiveshell.py", line 679, in __init__
    self.init_magics()
  File "D:\Projects\sample_project\venv37\lib\site-packages\ipykernel\zmqshell.py", line 593, in init_magics

    super(ZMQInteractiveShell, self).init_magics()
  File "D:\Projects\sample_project\venv37\lib\site-packages\IPython\core\interactiveshell.py", line 2223, in init_magics
    m.NamespaceMagics, m.OSMagics, m.PylabMagics, m.ScriptMagics,
  File "D:\Projects\sample_project\venv37\lib\site-packages\IPython\core\magic.py", line 386, in register
    m = m(shell=self.shell)
  File "D:\Projects\sample_project\venv37\lib\site-packages\IPython\core\magics\osm.py", line 52, in __init__
    self.execre = re.compile(r'(.*)\.(%s)$' % winext,re.IGNORECASE)
  File "D:\Projects\sample_project\venv37\lib\re.py", line 234, in compile
    return _compile(pattern, flags)
  File "D:\Projects\sample_project\venv37\lib\re.py", line 286, in _compile
    p = sre_compile.compile(pattern, flags)
  File "D:\Projects\sample_project\venv37\lib\sre_compile.py", line 764, in compile
    p = sre_parse.parse(p, flags)
  File "D:\Projects\sample_project\venv37\lib\sre_parse.py", line 930, in parse
    p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, 0)
  File "D:\Projects\sample_project\venv37\lib\sre_parse.py", line 426, in _parse_sub
    not nested and not items))
  File "D:\Projects\sample_project\venv37\lib\sre_parse.py", line 816, in _parse
    p = _parse_sub(source, state, sub_verbose, nested + 1)
  File "D:\Projects\sample_project\venv37\lib\sre_parse.py", line 426, in _parse_sub
    not nested and not items))
  File "D:\Projects\sample_project\venv37\lib\sre_parse.py", line 507, in _parse
    code = _escape(source, this, state)
  File "D:\Projects\sample_project\venv37\lib\sre_parse.py", line 402, in _escape
    raise source.error("bad escape %s" % escape, len(escape))
re.error: bad escape \P at position 59

我已经更新了所有软件包,还重新安装了jupyter软件包,但没有帮助。 你们知道有什么问题吗?

操作系统:Windows 10
python版本:3.7

0 个答案:

没有答案