PTVS icon indicating copy to clipboard operation
PTVS copied to clipboard

random module in python 2022 can't use random module

Open vsfeedback opened this issue 2 years ago • 2 comments

This issue has been moved from a ticket on Developer Community.


[severity:I'm unable to use this version] When using random module in python, I got stuck in an error that says " partially initialized module 'random' has no attribute 'randint' (most likely due to a circular import)" even when I copy a valid code


Original Comments

Feedback Bot on 7/10/2022, 10:57 PM:

(private comment, text removed)


Original Solutions

(no solutions)

vsfeedback avatar Jul 20 '22 16:07 vsfeedback

Could you please check if you have another module named random?

judej avatar Jul 20 '22 18:07 judej

Could you also please add the logs? You can set the logging to trace? You can do that by going to : Tools -> Options -> Python -> Analysis and setting the log level to trace.

image

judej avatar Jul 20 '22 18:07 judej

Going to close this out. If the issue still persists, please reopen with the information requested. Thanks.😊

StellaHuang95 avatar Aug 22 '22 17:08 StellaHuang95