LoginSignup
0
0

More than 1 year has passed since last update.

AttributeError: 'PosixPath' object has no attribute 'read_text'の対処法 環境

Posted at

環境

$uname -a
Linux Ubuntu 5.4.0-146-generic #163-Ubuntu SMP Fri Mar 17 18:26:02 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

$cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.6 LTS"

condaコマンドを叩くと,

AttributeError: 'PosixPath' object has no attribute 'read_text'

とエラーが出る.

結論

私の環境だと,pathlibを削除すると直りました.

pip uninstall pathlib

エラーが出るようになった経緯

lightgbmのバージョンを最新のもの(3.1.2→3.3.5)にアップデートした瞬間に起きた.
pathlibを削除してなぜ動いたのかはわからない.

参考文献

この記事は以下の情報を参考にして執筆しました。

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