小编mla*_*a01的帖子

AttributeError:模块“IPython.utils.traitlets”没有属性“Unicode”

我正在 Kaggle 服务器上运行 .ipynb 笔记本。

在第一个代码单元中,导入模块时,特别是来自 google.patches 的 cv2_imshow,如下所示,

from google.colab.patches import cv2_imshow

我收到此错误:

/opt/conda/lib/python3.7/site-packages/IPython/utils/traitlets.py:5: UserWarning: IPython.utils.traitlets has moved to a top-level traitlets package.
  warn("IPython.utils.traitlets has moved to a top-level traitlets package.")
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/tmp/ipykernel_27/1840971195.py in <module>
     18 
     19 # Display images using OpenCV
---> 20 from google.colab.patches import cv2_imshow                                                      # Importing cv2_imshow from google.patches to display images
     21 
     22 # Ignore warnings

/opt/conda/lib/python3.7/site-packages/google/colab/__init__.py in <module>
     24 from google.colab import _tensorflow_magics
     25 from google.colab import …
Run Code Online (Sandbox Code Playgroud)

module attributeerror kaggle google-colaboratory python-traitlets

4
推荐指数
2
解决办法
3038
查看次数