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

    気象庁の天気予報をBeautifulSoup4でスクレイピング

    気象庁の天気予報をBeautifulSoup4でスクレイピングします。サンプルとして群馬県の週間天気予報(場所、日付、曜日、最高気温、最低気温)を取得します。 コードはGitHubリポジトリにあげています。 週間天気予報 […]

    Posted on by press
    Python

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

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

    Posted on by press