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

    Pythonのdatetimeで日付や時刻を扱う

    Pythonのdatetimeで日付や時刻を扱う Pythonには日付や日時を扱うdatetimeモジュールがあります。今回はこのdatetimeモジュールを解説します。 開発環境 現在の日付を取得 現在の時刻を取得 現 […]

    Posted on by press
    Python

    PythonistaでiPhoneから株価をスクレイピング

    Pythonistaには多くのモジュールがプリインストールされていて、スクレイピングに必要なBeautifulSoupも初めから使える様になっています。そこで、今回はiOSアプリのPythonistaを使ってiPhone […]

    Posted on by press