Python 2.7.2 - Cannot import name _random or random from sys -


im few months new python , pulling hair out on trying generate random integer. ive been scouring internet, tried many solutions provided on here nothing takes. python doesnt seem know has random module, though can see right there in lib. ive tried:

  • copied relative .py doc , did import random without sys , same error.
  • in interactive found "_random", import _random doesn't give me line 1 error, says random not defined though ive copied , pasted numerous random number code examples straight python , many site stated worked them.

about throw in towel

tried post pic apparently not "reputable" enough. exact error is:

macintosh:week 03a ersander$ python secretdoor.py traceback (most recent call last):   file "secretdoor.py", line 1, in <module>     sys import _random importerror: cannot import name _random 

import random 

random isn't in sys. don't know why you're trying import there.


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -