1
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.

importするライブラリと同じファイル名で実行してエラー

Posted at

基本的なことでハマってしまったので、
備忘録として残します。

下記のthreading.pyというファイルを実行しようとして、エラーではまってしまいました。

threading.py
import threading

エラー内容は下記のとおり

AttributeError: partially initialized module 'threading' has no attribute 'RLock' (most likely due to a circular import)

解決方法

ファイル名を変更

threading.py → threading_test.py

これだけでエラーが解消しました。

けっこうエラー文だけからは判断しずらいですよね....

1
0
1

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
1
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?