标签: python-traitlets

ipykernel(Jupyter 笔记本/实验室)无法从 Traitlets.utils 导入名称“filefind”

我在 EC2 实例上安装了 Jupyter 笔记本和实验室,由于某种原因,我收到以下错误:

ImportError:无法从“traitlets.utils”导入名称“filefind”(/usr/lib/python3/dist-packages/traitlets/utils/ init .py)

Jupyter 在浏览器中可以正常打开,但我似乎无法在 python 笔记本中工作。

python python-3.x jupyter-notebook python-traitlets

9
推荐指数
2
解决办法
2万
查看次数

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
查看次数