simple-crypt icon indicating copy to clipboard operation
simple-crypt copied to clipboard

ImportError: No module named 'winrandom'

Open besnik opened this issue 9 years ago • 2 comments

Had problem on Windows 7 and Python 3.5.2 (64bit) when importing simplecrypt the system complained: ImportError: No module named 'winrandom' Seems to be coming from Crypto.Random.random import getrandbits

Anyway as suggested here by @neRok00 following solved situation for me:

Problem is solved by editing string in crypto\Random\OSRNG\nt.py: import winrandom to from . import winrandom

besnik avatar Dec 01 '16 13:12 besnik

ok, thanks. that's a problem in crypto, so i can't alter it, but i'll add a comment in the docs.

andrewcooke avatar Dec 01 '16 13:12 andrewcooke

I got a solution :

you should try this at nt.py under site-packages\Crypto\Random\OSRNG

from : importwinrandom

to :

fromCrypto.Random.OSRNGimportwinrandom

It should be at line 28

It worked perfectly fine afterwards. It might not work with other versions of python ( idk ) , but it will definitely work in 3.7 or 3.8

  • I'm just 11 yrs old and a full stack developer

Shaan-Lashkari avatar Oct 05 '22 08:10 Shaan-Lashkari