我正在尝试运行jupyter笔记本。但出现以下错误:

时间:2019-07-17 12:23:55

标签: python jupyter-notebook

我正在尝试运行jupyter笔记本。但出现以下错误:

> Traceback (most recent call last):   File
> "c:\users\lenovo\appdata\local\programs\python\python37\lib\runpy.py",
> line 193, in _run_module_as_main
>     "__main__", mod_spec)   File "c:\users\lenovo\appdata\local\programs\python\python37\lib\runpy.py",
> line 85, in _run_code
>     exec(code, run_globals)   File "C:\Users\lenovo\AppData\Local\Programs\Python\Python37\Scripts\jupyter-notebook.EXE\__main__.py",
> line 5, in <module>   File
> "c:\users\lenovo\appdata\local\programs\python\python37\lib\site-packages\notebook\notebookapp.py",
> line 47, in <module>
>     from zmq.eventloop import ioloop   File "C:\Users\lenovo\AppData\Roaming\Python\Python37\site-packages\zmq\__init__.py",
> line 47, in <module>
>     from zmq import backend   File "C:\Users\lenovo\AppData\Roaming\Python\Python37\site-packages\zmq\backend\__init__.py",
> line 40, in <module>
>     reraise(*exc_info)   File "C:\Users\lenovo\AppData\Roaming\Python\Python37\site-packages\zmq\utils\sixcerpt.py",
> line 34, in reraise
>     raise value   File "C:\Users\lenovo\AppData\Roaming\Python\Python37\site-packages\zmq\backend\__init__.py",
> line 27, in <module>
>     _ns = select_backend(first)   File "C:\Users\lenovo\AppData\Roaming\Python\Python37\site-packages\zmq\backend\select.py",
> line 28, in select_backend
>     mod = __import__(name, fromlist=public_api)   File "C:\Users\lenovo\AppData\Roaming\Python\Python37\site-packages\zmq\backend\cython\__init__.py",
> line 6, in <module>
>     from . import (constants, error, message, context, ImportError: cannot import name 'constants' from 'zmq.backend.cython'
> (C:\Users\lenovo\AppData\Roaming\Python\Python37\site-packages\zmq\backend\cython\__init__.py)

1 个答案:

答案 0 :(得分:1)

尝试:

pip uninstall pyzmq
pip install pyzmq