I am running a .ipynb notebook on a Kaggle server.
At the first code cell, when importing modules, specifically cv2_imshow from google.patches as follows,
from google.colab.patches import cv2_imshow
I get this error:
/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 auth
---> 26 from google.colab import data_table
27 from google.colab import drive
28 from google.colab import files
/opt/conda/lib/python3.7/site-packages/google/colab/data_table.py in <module>
164
165
--> 166 class _JavascriptModuleFormatter(_IPython.core.formatters.BaseFormatter):
167 format_type = _traitlets.Unicode(_JAVASCRIPT_MODULE_MIME_TYPE)
168 print_method = _traitlets.ObjectName('_repr_javascript_module_')
/opt/conda/lib/python3.7/site-packages/google/colab/data_table.py in _JavascriptModuleFormatter()
165
166 class _JavascriptModuleFormatter(_IPython.core.formatters.BaseFormatter):
--> 167 format_type = _traitlets.Unicode(_JAVASCRIPT_MODULE_MIME_TYPE)
168 print_method = _traitlets.ObjectName('_repr_javascript_module_')
169
AttributeError: module 'IPython.utils.traitlets' has no attribute 'Unicode'
After running
from traitlets import *
print(traitlets)
<module 'traitlets.traitlets' from '/opt/conda/lib/python3.7/site-packages/traitlets/traitlets.py'>
and re-running the problem line, to deal with the top part of the error message,
/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.")
This part of the error message dissappears but all else remains the same.
google-colab 1.0.0