0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

python3.11にpipでscikit-learnをインストールしてコード実行したらエラー発生

Posted at

はじめに

python3.9で実験していたscikit-learnを使ったpythonのコードをpython3.11で動かしてみようと思いたち、まずはpipでscikit-learnをインストール。

macos$ pip3.11 install scikit-learn

おそらく最新版のscikit-learnがインストールされた。

こんなエラーが発生(抜粋)

この状態で件のコードを実行してみると、以下のようなエラーメッセージが出て実行できず

ValueError: node array from the pickle has an incompatible dtype:

ソースコードを書き直さなきゃ行けないのかな、と思いつつ、先人の知恵を探しにgoogle検索を…

対応策を発見

参考URLによると、ダウングレードせよ、とのこと。

macos$ pip3.11 install scikit-learn==1.2.2

この対応にてとりあえず使えるようになった。しかし、いずれソースコードの見直しは必要なことには代わりはない

最後に

qiita-cliがかなり便利なので、思わず作業メモを投稿

0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?