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

    Django

    pipenv shellをしてもactivateできない

    pipenv shellをしてもactivateできない pipenvで作った仮想環境に出たり入ったりを繰り返していると、pipenv shellをしても以下のようにShell for UNKNOWN_VIRTUAL_E […]

    Posted on by press
    Python

    PythonでXserverからメール送信

    PythonでXserverからメール送信 レンタルサーバーで処理が終わった時や進捗を確認したいときにPythonでメールを送る方法です。今回はXserverでPythonを実行していますが、他のレンタルサーバーでもホス […]

    Posted on by press