見出し画像

環境構築はいつも面倒だ#05: Jupyter LabとTeradata SQL Kernelのアップグレード

ある日Jupyter Labを触っていたら、画面の右下にアップグレードがあるよみたいな通知が来ていました。アップグレードしようと思って調べていると以下を見つけました。

これに基づいて関連パッケージをアップグレード。まず、以下のコマンドでjupyter関連のパッケージがリストされるのでそれを確認

jupyter --version

結果はこんな感じ

Selected Jupyter core packages...
IPython          : 8.10.0
ipykernel        : 6.21.1
ipywidgets       : 8.0.4
jupyter_client   : 8.0.2
jupyter_core     : 5.2.0
jupyter_server   : 2.2.1
jupyterlab       : 3.6.1
nbclient         : 0.7.2
nbconvert        : 7.2.9
nbformat         : 5.7.3
notebook         : 6.5.2
qtconsole        : 5.4.0
traitlets        : 5.9.0

これに基づいてリストアップされたパッケージをアップグレードする

pip install --upgrade IPython ipykernel ipywidgets jupyter_client jupyter_core jupyter_server jupyterlab nbclient nbconvert nbformat notebook qtconsole traitlets

これでJupyter Lab自体はアップグレードされたっぽいけど、気になるエラーメッセージがログの中にありました。

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
jupyter-server-fileid 0.6.0 requires jupyter-events~=0.5.0, but you have jupyter-events 0.7.0 which is incompatible.
teradata-connection-manager-prebuilt 3.4.0 requires jupyterlab==3.,>=3.0.0rc13, but you have jupyterlab 4.0.5 which is incompatible.
teradata-database-explorer-prebuilt 3.4.0 requires jupyterlab==3.,>=3.0.0rc13, but you have jupyterlab 4.0.5 which is incompatible.
teradata-preferences-prebuilt 3.4.0 requires jupyterlab==3.,>=3.0.0rc13, but you have jupyterlab 4.0.5 which is incompatible.
teradata-resultset-renderer-prebuilt 3.4.0 requires jupyterlab==3.,>=3.0.0rc13, but you have jupyterlab 4.0.5 which is incompatible.
teradata-sqlhighlighter-prebuilt 3.4.0 requires jupyterlab==3.*,>=3.0.0rc13, but you have jupyterlab 4.0.5 which is incompatible.

実際にJupyter LabでTeradataカーネルを動かしてみると、一部画面の表示がおかしくなるのと、select文の結果が表示されなかったりしてしまう。なので追加で以下を実行

pip install --upgrade jupyter-server-fileid teradata-connection-manager-prebuilt teradata-database-explorer-prebuilt teradata-preferences-prebuilt teradata-resultset-renderer-prebuilt teradata-sqlhighlighter-prebuilt 

これで以前通り動いてくれるようになりました。ただ、ログメッセージを見る限り、いったんインストールしたJupyter Lab 4.0.5をアンインストールして、Teradata SQL Kernelが動くバージョン(3.6.5)をインストールしなおしているみたいですね。実際、以下のコマンドでバージョンを確認すると、3.6.5と表示されます

jupyter lab --version

以上です。

#teradata #jupyterlab  

///

この記事が気に入ったらサポートをしてみませんか?