AttributeError: module ‘numpy’ has no attribute ‘float’


press
AttributeError: module ‘numpy’...

AttributeError: module ‘numpy’ has no attribute ‘float’

numpyを使ったライブラリをコマンド実行した際に以下のエラーが発生したときの解決方法です。このエラーはnumpy 1.24.0のバージョンから発生するようなので、バージョンを下げたnumpyを再インストールしたら解決しました。

AttributeError: module 'numpy' has no attribute 'float'

一度numpyをアンインストールしてから再度バージョンを指定したnumpyを再インストールします。

pip uninstall numpy && pip install --ignore-installed numpy==1.23.4

株式会社ファントムへのお問い合わせ

群馬県でPythonを使ったAIやソフトウェアを開発している株式会社ファントムが運営しています。




    Related Articles

    Python

    生成したリスト同士を計算する方法

    リストをループで生成してリスト同士を計算する方法です。サンプルでは、[0, 1, 2, 3, 4]のリストを3個生成して計算します。 loopOneで3を代入しているのでリストを3回計算します。loopTwoで5を代入し […]

    Posted on by press
    Python

    PythonからDeepLのAPIを使って翻訳

    PythonからDeepLのAPIを使って翻訳 最先端のAI技術を使った世界最高レベルの機械翻訳のDeepLをAPIで操作します。deeplのライブラリを使うとPythonで書く通常のPOSTのコードよりも記述量を少なく […]

    Posted on by press