gpt4 book ai didi

python - jupyter 笔记本,导入错误 : cannot import name 'Type'

转载 作者:行者123 更新时间:2023-12-01 13:15:48 25 4
gpt4 key购买 nike

我是 Windows 用户,我的电脑上安装了 Python 3.6。为了使用 Jupyter notebooks,我下载了 atom。我已经安装了 ipython 和 pandas。输入命令后jupyter notebook在命令行上,我的浏览器没有打开 jupyter notebook,而是收到以下错误消息:

[C:\Users\ELIDAD>jupyter notebook
Traceback (most recent call last):
File "c:\users\elidad\appdata\local\programs\python\python35\lib\runpy.py", line 170, in _run_module_as_main
"__main__", mod_spec)
File "c:\users\elidad\appdata\local\programs\python\python35\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\ELIDAD\AppData\Local\Programs\Python\Python35\Scripts\jupyter-notebook.EXE\__main__.py", line 5, in <module>
File "c:\users\elidad\appdata\local\programs\python\python35\lib\site-packages\notebook\__init__.py", line 25, in <module>
from .nbextensions import install_nbextension
File "c:\users\elidad\appdata\local\programs\python\python35\lib\site-packages\notebook\nbextensions.py", line 610, in <module>
from .extensions import (
File "c:\users\elidad\appdata\local\programs\python\python35\lib\site-packages\notebook\extensions.py", line 8, in <module>
from tornado.log import LogFormatter
File "c:\users\elidad\appdata\local\programs\python\python35\lib\site-packages\tornado\log.py", line 34, in <module>
from tornado.escape import _unicode
File "c:\users\elidad\appdata\local\programs\python\python35\lib\site-packages\tornado\escape.py", line 27, in <module>
from tornado.util import unicode_type
File "c:\users\elidad\appdata\local\programs\python\python35\lib\site-packages\tornado\util.py", line 21, in <module>
from typing import (
ImportError: cannot import name 'Type']

那么,问题是什么?我是 python 和 jupyter notebook 的新手。非常感谢。

最佳答案

这是因为 Python3.5 有自己的版本打字( https://docs.python.org/3/library/typing.html ),与已安装的 jupyter/tornado 版本不兼容
升级到python3.6可以解决问题。

关于python - jupyter 笔记本,导入错误 : cannot import name 'Type' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55210213/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com