python3.10使用jupyter notebook报错:‘attributeerror: module ‘collections‘ has no attribute ‘callable’’
进入python安装路径下的Python310\Lib\site-packages\pyreadline。如果没找到pyreadline这个文件夹需要手动安装pyreadline。保存,退出,重新打开jupyter notebook。打开py3k_compat.py。找到你python安装路径 (
·
报错原因
collections.Callable has been moved to collections.abc.Callable in python 3.10+
解决方法:
-
找到你python安装路径 (如何获取python的安装路径)
-
进入python安装路径下的Python310\Lib\site-packages\pyreadline。
如果没找到pyreadline这个文件夹需要手动安装pyreadline
pip install pyreadline
-
打开py3k_compat.py
-
将第8行从
isinstance(x, collections.Callable)
更改为isinstance(x, collections.abc.Callable)
。 -
保存,退出,重新打开jupyter notebook
更多推荐
所有评论(0)