R
R
Ray Dostoyevsky2021-09-23 14:20:16
Python
Ray Dostoyevsky, 2021-09-23 14:20:16

Why doesn't the random module work?

I used the module for generating random numbers, and now it has stopped working. Whole code:

import random
print(random.randint(0,1))

And here is the error:
Traceback (most recent call last):
File "C:\Users\Dostoewsky\Desktop\projects\python_projects\random.py", line 1, in
import random
File "C:\Users\Dostoewsky\Desktop\projects \python_projects\random.py", line 2, in
print(random.randint(0,1))
AttributeError: partially initialized module 'random' has no attribute 'randint' (most likely due to a circular import)
[Finished in 108ms with exit code 1]
[cmd: ['py', '-u', 'C:\\Users\\Dostoewsky\\Desktop\\projects\\python_projects\\random.py']]
[dir: C:\ Users\Dostoewsky\Desktop\projects\python_projects]
[path: C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C: \Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Users\Dostoewsky\AppData\Local\Programs\Python\Python38\ Scripts\;C:\Users\Dostoewsky\AppData\Local\Programs\Python\Python38\]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2021-09-23
@RayProgrammer

Copy the error, paste it into the search
https://qna.habr.com/q/925781
https://qna.habr.com/q/928383
https://qna.habr.com/q/986365
https://qna .habr.com/q/829287
https://qna.habr.com/q/1035588
https://qna.habr.com/q/976661
https://qna.habr.com/q/777629

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question