python - jupyter笔记本没有运行

标签 python jupyter-notebook

当我输入终端 py -m jupyter notebook 时出现此错误

Traceback (most recent call last):
  File "c:\users\dos\appdata\local\programs\python\python35-32\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\dos\appdata\local\programs\python\python35-32\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\DOs\AppData\Local\Programs\Python\Python35-32\Scripts\jupyter-notebook.EXE\__main__.py", line 5, in <module>
  File "c:\users\dos\appdata\local\programs\python\python35-32\lib\site-packages\notebook\notebookapp.py", line 81, in <module>
    from .services.kernels.kernelmanager import MappingKernelManager, AsyncMappingKernelManager
  File "c:\users\dos\appdata\local\programs\python\python35-32\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 18, in <module>
    from jupyter_client.session import Session
  File "C:\Users\DOs\AppData\Roaming\Python\Python35\site-packages\jupyter_client\__init__.py", line 6, in <module>
    from .asynchronous import AsyncKernelClient  # noqa
  File "C:\Users\DOs\AppData\Roaming\Python\Python35\site-packages\jupyter_client\asynchronous\__init__.py", line 1, in <module>
    from .client import AsyncKernelClient  # noqa
  File "C:\Users\DOs\AppData\Roaming\Python\Python35\site-packages\jupyter_client\asynchronous\client.py", line 6, in <module>
    from jupyter_client.channels import HBChannel
  File "C:\Users\DOs\AppData\Roaming\Python\Python35\site-packages\jupyter_client\channels.py", line 46
    time_to_dead: float = 1.0
                ^
SyntaxError: invalid syntax

这个错误的原因是什么?

最佳答案

另一种方法是将 jupyter-client 版本降低到 6.1.12

你可以这样做

pip3 install --upgrade jupyter-client==6.1.12

关于python - jupyter笔记本没有运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67139573/

相关文章:

基于 Python 的 Gallery Web 应用程序?

jupyter - 执行 jupyter nbconvert 时出现 TypeError

opencv - 导入错误 : No module named 'cv2' using jupyter

python - 导入时未定义枚举对象 - 通过 Jupyter Notebook 的 Python 3

python - 在模板上显示 Django 管理操作

python - 如何在 MacOS 上绝对卸载 python 2.7

python - 搜索 .db 中包含关键字的特定行

python - 如何删除行和列的索引名称? (轴=0 & 轴=1)

python - Jupyter notebook 中的 !ls (Python 3)

python - 根据另一列的值替换 pandas DataFrame 中的值