0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【Python】iterdir()など使用時に出る[Errno 20] Not a directory: '***/.DS_Store'

Posted at

Pythonでiterdir()などを使うと、タイトルのようなエラーが出てきます。
Mac独自の.DS_Storeという隠しファイルのせいで、関数が実行できない時出てきます。
対処としては、.DS_Storeを消せば良いだけです。

そもそも.DS_Storeとは

.DS_Store は、Finderがフォルダの設定を記録するためのファイルです。
参考サイト

対処

ファインダーでもコマンドラインでもいいので消します。

コマンドラインの場合、
邪魔な.DS_Storeが入っているフォルダに移動し

find . -name ".DS_Store" -delete

で消します。
参考サイト

終了です。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?