質問するログイン新規登録

質問編集履歴

2

コメントを頂いて疑問が生まれたので追記しました。

2024/04/28 05:42

投稿

pro-grammar
pro-grammar

スコア1

title CHANGED
File without changes
body CHANGED
@@ -32,4 +32,6 @@
32
32
  もともとrandom.pyというファイル名で作っていて、AttributeError: partially initialized module 'random' has no attribute 'randint' (most likely due to a circular import)というエラーが発生していました。それをランダム.pyに変えましたが別のエラーが発生しました。randintとちゃんと書いているのでタイプミスではないと思います。
33
33
 
34
34
  ### 補足
35
- (追記)pythonを実行している環境はWindows11 intel core i7 で、Visual Studio Codeを使っています。pythonのバージョンはv2024.4.1です。
35
+ (追記)pythonを実行している環境はWindows11 intel core i7 で、Visual Studio Codeを使っています。pythonのバージョンはv2024.4.1です。
36
+
37
+ (追記2)PC上にはrandom.pyが残っていますが、それではないファイル上でコードを実行しています。PC上にファイルがあるとそちらがインポートされてしまうのでしょうか?

1

実行環境を追記しました。

2024/04/28 04:41

投稿

pro-grammar
pro-grammar

スコア1

title CHANGED
File without changes
body CHANGED
@@ -32,4 +32,4 @@
32
32
  もともとrandom.pyというファイル名で作っていて、AttributeError: partially initialized module 'random' has no attribute 'randint' (most likely due to a circular import)というエラーが発生していました。それをランダム.pyに変えましたが別のエラーが発生しました。randintとちゃんと書いているのでタイプミスではないと思います。
33
33
 
34
34
  ### 補足
35
- 特にな
35
+ (追記)pythonを実行ている環境はWindows11 intel core i7 で、Visual Studio Codeを使っています。pythonのバージョンはv2024.4.1です。