0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

CERN ROOT Jupyter notebook がImportError: cannot import name 'NeutralColors'で使えない

Posted at

概要

CERN ROOT Jupyter notebookで立ち上げたがCERN ROOTを使おうとすると以下のエラーが出て使えないときの対処。

ImportError: cannot import name 'NeutralColors' from 'IPython.utils.PyColorize'

環境

> sw_vers 
ProductName:		macOS
ProductVersion:		15.3.2
BuildVersion:		24D81

> root --version
ROOT Version: 6.34.06
Built for macosxarm64 on Mar 27 2025, 04:39:07
From tags/6-34-06@6-34-06

> python --version
Python 3.13.2

原因 & 対処

最近、CERN ROOTのバージョンアップに合わせて、pyenvで新たに最新バージョンのPythonJupyterのインストールしたところ上記のエラーが出ました。
調べたところJupyterのバージョンは前と同じでしたが、ipythonがメジャーバージョンアップされていて9.0.2になっていました。

> pip list
 ~省略~
ipython                   9.0.2
 ~省略~

対処法としてはipythonを以下のコマンドでダウングレードしました。

> pip install 'ipython>8,<9'
 ~省略~

> pip list
 ~省略~
ipython                   8.34.0
 ~省略~

上記のコマンドはipythonがインストールされたままでもOKです。uninstallする必要はありませんでした。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?